1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//! Tests for hash() function.
use crate::interpreter::test::make_interpreter_test;
make_interpreter_test!(
hash,
(
ident,
{ alias = hash(FooBar) },
{
fn alias() -> u32 { 1 }
},
{
// We prefix the hash result for an ident-arg prefixed with "__".
fn __1864179433826574950() -> u32 { 1 }
},
None,
),
(
str,
{ alias = hash("foo") },
{
fn my_fn() -> &str { alias }
},
{
fn my_fn() -> &str { "10172337927241793445" }
},
None,
),
(
tokens,
{ alias = hash(let x = 1;) },
{
fn alias() -> u32 { 1 }
},
{
fn __18050448427594546802() -> u32 { 1 }
},
None,
),
);