checkout trunk

This commit is contained in:
satotake 2021-11-08 11:13:17 +00:00 committed by GitHub
parent c8f7a98d74
commit b8340b47c6
5 changed files with 31 additions and 48 deletions

View file

@ -9,7 +9,7 @@ fn basic_hash() {
assert_evals_to!(
indoc!(
r#"
Dict.#hashTestOnly 0 0
Dict.hashTestOnly 0 0
"#
),
9718519427346233646,
@ -19,19 +19,15 @@ fn basic_hash() {
#[test]
fn hash_str_with_seed() {
assert_evals_to!("Dict.#hashTestOnly 1 \"a\"", 0xbed235177f41d328, u64);
assert_evals_to!("Dict.#hashTestOnly 2 \"abc\"", 0xbe348debe59b27c3, u64);
assert_evals_to!("Dict.hashTestOnly 1 \"a\"", 0xbed235177f41d328, u64);
assert_evals_to!("Dict.hashTestOnly 2 \"abc\"", 0xbe348debe59b27c3, u64);
}
#[test]
fn hash_record() {
assert_evals_to!("Dict.hashTestOnly 1 { x: \"a\" } ", 0xbed235177f41d328, u64);
assert_evals_to!(
"Dict.#hashTestOnly 1 { x: \"a\" } ",
0xbed235177f41d328,
u64
);
assert_evals_to!(
"Dict.#hashTestOnly 1 { x: 42, y: 3.14 } ",
"Dict.hashTestOnly 1 { x: 42, y: 3.14 } ",
5348189196103430707,
u64
);
@ -40,7 +36,7 @@ fn hash_record() {
#[test]
fn hash_result() {
assert_evals_to!(
"Dict.#hashTestOnly 0 (List.get [ 0x1 ] 0) ",
"Dict.hashTestOnly 0 (List.get [ 0x1 ] 0) ",
2878521786781103245,
u64
);
@ -56,7 +52,7 @@ fn hash_linked_list() {
input : LinkedList I64
input = Nil
Dict.#hashTestOnly 0 input
Dict.hashTestOnly 0 input
"#
),
0,
@ -71,7 +67,7 @@ fn hash_linked_list() {
input : LinkedList I64
input = Cons 4 (Cons 3 Nil)
Dict.#hashTestOnly 0 input
Dict.hashTestOnly 0 input
"#
),
8287696503006938486,
@ -92,7 +88,7 @@ fn hash_expr() {
add : Expr
add = Add x x
Dict.#hashTestOnly 0 add
Dict.hashTestOnly 0 add
"#
),
10825806964604997723,
@ -113,7 +109,7 @@ fn hash_nullable_expr() {
add : Expr
add = Add x x
Dict.#hashTestOnly 0 add
Dict.hashTestOnly 0 add
"#
),
1907558799788307114,
@ -131,7 +127,7 @@ fn hash_rosetree() {
x : Rose I64
x = Rose []
Dict.#hashTestOnly 0 x
Dict.hashTestOnly 0 x
"#
),
0,
@ -152,7 +148,7 @@ fn hash_union_same_content() {
b : Foo
b = B 42
{ a: Dict.#hashTestOnly 0 a, b : Dict.#hashTestOnly 0 b }
{ a: Dict.hashTestOnly 0 a, b : Dict.hashTestOnly 0 b }
"#
),
true,
@ -174,7 +170,7 @@ fn hash_recursive_union_same_content() {
v2 : Expr
v2 = Val2 42
{ a: Dict.#hashTestOnly 0 v1, b : Dict.#hashTestOnly 0 v2 }
{ a: Dict.hashTestOnly 0 v1, b : Dict.hashTestOnly 0 v2 }
"#
),
true,
@ -196,7 +192,7 @@ fn hash_nullable_recursive_union_same_content() {
v2 : Expr
v2 = Val2 42
{ a: Dict.#hashTestOnly 0 v1, b : Dict.#hashTestOnly 0 v2 }
{ a: Dict.hashTestOnly 0 v1, b : Dict.hashTestOnly 0 v2 }
"#
),
true,
@ -213,7 +209,7 @@ fn hash_list() {
x : List Str
x = [ "foo", "bar", "baz" ]
Dict.#hashTestOnly 0 x
Dict.hashTestOnly 0 x
"#
),
10731521034618280801,