change headers

This commit is contained in:
Folkert 2021-03-01 15:15:05 +01:00
parent 3e3fe4fc7a
commit ef362ada26
11 changed files with 4402 additions and 4487 deletions

View file

@ -1,22 +1,12 @@
#[macro_use] #![cfg(test)]
extern crate pretty_assertions;
#[macro_use]
extern crate indoc;
extern crate bumpalo; use crate::assert_evals_to;
extern crate inkwell; use crate::assert_llvm_evals_to;
extern crate libc; use indoc::indoc;
extern crate roc_gen; use roc_std::RocStr;
#[macro_use] #[test]
mod helpers; fn dict_empty_len() {
#[cfg(test)]
mod gen_dict {
use roc_std::RocStr;
#[test]
fn dict_empty_len() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -26,10 +16,10 @@ mod gen_dict {
0, 0,
usize usize
); );
} }
#[test] #[test]
fn dict_insert_empty() { fn dict_insert_empty() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -40,10 +30,10 @@ mod gen_dict {
1, 1,
usize usize
); );
} }
#[test] #[test]
fn dict_empty_contains() { fn dict_empty_contains() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -56,10 +46,10 @@ mod gen_dict {
false, false,
bool bool
); );
} }
#[test] #[test]
fn dict_nonempty_contains() { fn dict_nonempty_contains() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -72,10 +62,10 @@ mod gen_dict {
true, true,
bool bool
); );
} }
#[test] #[test]
fn dict_empty_remove() { fn dict_empty_remove() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -90,10 +80,10 @@ mod gen_dict {
0, 0,
i64 i64
); );
} }
#[test] #[test]
fn dict_nonempty_remove() { fn dict_nonempty_remove() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -108,10 +98,10 @@ mod gen_dict {
0, 0,
i64 i64
); );
} }
#[test] #[test]
fn dict_nonempty_get() { fn dict_nonempty_get() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -150,10 +140,10 @@ mod gen_dict {
0.0, 0.0,
f64 f64
); );
} }
#[test] #[test]
fn keys() { fn keys() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -171,10 +161,10 @@ mod gen_dict {
&[0, 1, 2], &[0, 1, 2],
&[i64] &[i64]
); );
} }
#[test] #[test]
fn values() { fn values() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -192,10 +182,10 @@ mod gen_dict {
&[100, 200, 300], &[100, 200, 300],
&[i64] &[i64]
); );
} }
#[test] #[test]
fn from_list_with_fold() { fn from_list_with_fold() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -234,10 +224,10 @@ mod gen_dict {
25, 25,
i64 i64
); );
} }
#[test] #[test]
fn small_str_keys() { fn small_str_keys() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -255,10 +245,10 @@ mod gen_dict {
&[RocStr::from("c"), RocStr::from("a"), RocStr::from("b"),], &[RocStr::from("c"), RocStr::from("a"), RocStr::from("b"),],
&[RocStr] &[RocStr]
); );
} }
#[test] #[test]
fn big_str_keys() { fn big_str_keys() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -280,10 +270,10 @@ mod gen_dict {
], ],
&[RocStr] &[RocStr]
); );
} }
#[test] #[test]
fn big_str_values() { fn big_str_values() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -304,10 +294,10 @@ mod gen_dict {
], ],
&[RocStr] &[RocStr]
); );
} }
#[test] #[test]
fn unit_values() { fn unit_values() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -325,10 +315,10 @@ mod gen_dict {
4, 4,
i64 i64
); );
} }
#[test] #[test]
fn singleton() { fn singleton() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -342,10 +332,10 @@ mod gen_dict {
1, 1,
i64 i64
); );
} }
#[test] #[test]
fn union() { fn union() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -359,10 +349,10 @@ mod gen_dict {
2, 2,
i64 i64
); );
} }
#[test] #[test]
fn union_prefer_first() { fn union_prefer_first() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -376,10 +366,10 @@ mod gen_dict {
&[100], &[100],
&[i64] &[i64]
); );
} }
#[test] #[test]
fn intersection() { fn intersection() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -406,10 +396,10 @@ mod gen_dict {
2, 2,
i64 i64
); );
} }
#[test] #[test]
fn intersection_prefer_first() { fn intersection_prefer_first() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -436,10 +426,10 @@ mod gen_dict {
&[4, 2], &[4, 2],
&[i64] &[i64]
); );
} }
#[test] #[test]
fn difference() { fn difference() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -466,10 +456,10 @@ mod gen_dict {
3, 3,
i64 i64
); );
} }
#[test] #[test]
fn difference_prefer_first() { fn difference_prefer_first() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -496,10 +486,10 @@ mod gen_dict {
&[5, 3, 1], &[5, 3, 1],
&[i64] &[i64]
); );
} }
#[test] #[test]
fn walk_sum_keys() { fn walk_sum_keys() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -518,5 +508,4 @@ mod gen_dict {
15, 15,
i64 i64
); );
}
} }

View file

@ -1,21 +1,11 @@
#[macro_use] #![cfg(test)]
extern crate pretty_assertions;
#[macro_use]
extern crate indoc;
extern crate bumpalo; use crate::assert_evals_to;
extern crate inkwell; use crate::assert_llvm_evals_to;
extern crate libc; use indoc::indoc;
extern crate roc_gen;
#[macro_use] #[test]
mod helpers; fn basic_hash() {
#[cfg(test)]
mod gen_hash {
#[test]
fn basic_hash() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -25,35 +15,35 @@ mod gen_hash {
9718519427346233646, 9718519427346233646,
u64 u64
); );
} }
#[test] #[test]
fn hash_str_with_seed() { fn hash_str_with_seed() {
assert_evals_to!("Dict.hashTestOnly 1 \"a\"", 0xbed235177f41d328, u64); assert_evals_to!("Dict.hashTestOnly 1 \"a\"", 0xbed235177f41d328, u64);
assert_evals_to!("Dict.hashTestOnly 2 \"abc\"", 0xbe348debe59b27c3, u64); assert_evals_to!("Dict.hashTestOnly 2 \"abc\"", 0xbe348debe59b27c3, u64);
} }
#[test] #[test]
fn hash_record() { 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!( assert_evals_to!(
"Dict.hashTestOnly 1 { x: 42, y: 3.14 } ", "Dict.hashTestOnly 1 { x: 42, y: 3.14 } ",
5348189196103430707, 5348189196103430707,
u64 u64
); );
} }
#[test] #[test]
fn hash_result() { fn hash_result() {
assert_evals_to!( assert_evals_to!(
"Dict.hashTestOnly 0 (List.get [ 0x1 ] 0) ", "Dict.hashTestOnly 0 (List.get [ 0x1 ] 0) ",
2878521786781103245, 2878521786781103245,
u64 u64
); );
} }
#[test] #[test]
fn hash_linked_list() { fn hash_linked_list() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -83,10 +73,10 @@ mod gen_hash {
8287696503006938486, 8287696503006938486,
u64 u64
); );
} }
#[test] #[test]
fn hash_expr() { fn hash_expr() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -101,10 +91,10 @@ mod gen_hash {
18264046914072177411, 18264046914072177411,
u64 u64
); );
} }
#[test] #[test]
fn hash_nullable_expr() { fn hash_nullable_expr() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -119,10 +109,10 @@ mod gen_hash {
11103255846683455235, 11103255846683455235,
u64 u64
); );
} }
#[test] #[test]
fn hash_rosetree() { fn hash_rosetree() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -137,10 +127,10 @@ mod gen_hash {
0, 0,
u64 u64
); );
} }
#[test] #[test]
fn hash_list() { fn hash_list() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -153,5 +143,4 @@ mod gen_hash {
10731521034618280801, 10731521034618280801,
u64 u64
); );
}
} }

File diff suppressed because it is too large Load diff

View file

@ -1,18 +1,8 @@
#[macro_use]
extern crate pretty_assertions;
#[macro_use]
extern crate indoc;
extern crate bumpalo;
extern crate inkwell;
extern crate libc;
extern crate roc_gen;
#[macro_use]
mod helpers;
#[cfg(test)] #[cfg(test)]
mod gen_num { mod gen_num {
use crate::assert_evals_to;
use crate::assert_llvm_evals_to;
use indoc::indoc;
use roc_std::RocOrder; use roc_std::RocOrder;
#[test] #[test]

View file

@ -1,20 +1,11 @@
#[macro_use] #![cfg(test)]
extern crate pretty_assertions;
#[macro_use]
extern crate indoc;
extern crate bumpalo; use crate::assert_evals_to;
extern crate inkwell; use crate::assert_llvm_evals_to;
extern crate libc; use indoc::indoc;
extern crate roc_gen;
#[macro_use] #[test]
mod helpers; fn basic_record() {
#[cfg(test)]
mod gen_records {
#[test]
fn basic_record() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -44,10 +35,10 @@ mod gen_records {
19, 19,
i64 i64
); );
} }
#[test] #[test]
fn f64_record() { fn f64_record() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -83,10 +74,10 @@ mod gen_records {
19.3, 19.3,
f64 f64
); );
} }
#[test] #[test]
fn fn_record() { fn fn_record() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -134,10 +125,10 @@ mod gen_records {
34, 34,
i64 i64
); );
} }
#[test] #[test]
fn def_record() { fn def_record() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -173,10 +164,10 @@ mod gen_records {
19, 19,
i64 i64
); );
} }
#[test] #[test]
fn when_on_record() { fn when_on_record() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -187,10 +178,10 @@ mod gen_records {
5, 5,
i64 i64
); );
} }
#[test] #[test]
fn when_record_with_guard_pattern() { fn when_record_with_guard_pattern() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -201,10 +192,10 @@ mod gen_records {
5, 5,
i64 i64
); );
} }
#[test] #[test]
fn let_with_record_pattern() { fn let_with_record_pattern() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -216,10 +207,10 @@ mod gen_records {
2, 2,
i64 i64
); );
} }
#[test] #[test]
fn record_guard_pattern() { fn record_guard_pattern() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -231,10 +222,10 @@ mod gen_records {
5, 5,
i64 i64
); );
} }
#[test] #[test]
fn twice_record_access() { fn twice_record_access() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -246,9 +237,9 @@ mod gen_records {
5, 5,
i64 i64
); );
} }
#[test] #[test]
fn empty_record() { fn empty_record() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -260,9 +251,9 @@ mod gen_records {
(), (),
() ()
); );
} }
#[test] #[test]
fn i64_record2_literal() { fn i64_record2_literal() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -272,23 +263,23 @@ mod gen_records {
(3, 5), (3, 5),
(i64, i64) (i64, i64)
); );
} }
// #[test] // #[test]
// fn i64_record3_literal() { // fn i64_record3_literal() {
// assert_evals_to!( // assert_evals_to!(
// indoc!( // indoc!(
// r#" // r#"
// { x: 3, y: 5, z: 17 } // { x: 3, y: 5, z: 17 }
// "# // "#
// ), // ),
// (3, 5, 17), // (3, 5, 17),
// (i64, i64, i64) // (i64, i64, i64)
// ); // );
// } // }
#[test] #[test]
fn f64_record2_literal() { fn f64_record2_literal() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -298,39 +289,39 @@ mod gen_records {
(3.1, 5.1), (3.1, 5.1),
(f64, f64) (f64, f64)
); );
} }
// #[test] // #[test]
// fn f64_record3_literal() { // fn f64_record3_literal() {
// assert_evals_to!( // assert_evals_to!(
// indoc!( // indoc!(
// r#" // r#"
// { x: 3.1, y: 5.1, z: 17.1 } // { x: 3.1, y: 5.1, z: 17.1 }
// "# // "#
// ), // ),
// (3.1, 5.1, 17.1), // (3.1, 5.1, 17.1),
// (f64, f64, f64) // (f64, f64, f64)
// ); // );
// } // }
// #[test] // #[test]
// fn bool_record4_literal() { // fn bool_record4_literal() {
// assert_evals_to!( // assert_evals_to!(
// indoc!( // indoc!(
// r#" // r#"
// record : { a : Bool, b : Bool, c : Bool, d : Bool } // record : { a : Bool, b : Bool, c : Bool, d : Bool }
// record = { a: True, b: True, c : True, d : Bool } // record = { a: True, b: True, c : True, d : Bool }
// record // record
// "# // "#
// ), // ),
// (true, false, false, true), // (true, false, false, true),
// (bool, bool, bool, bool) // (bool, bool, bool, bool)
// ); // );
// } // }
#[test] #[test]
fn i64_record1_literal() { fn i64_record1_literal() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -340,36 +331,36 @@ mod gen_records {
3, 3,
i64 i64
); );
} }
// #[test] // #[test]
// fn i64_record9_literal() { // fn i64_record9_literal() {
// assert_evals_to!( // assert_evals_to!(
// indoc!( // indoc!(
// r#" // r#"
// { a: 3, b: 5, c: 17, d: 1, e: 9, f: 12, g: 13, h: 14, i: 15 } // { a: 3, b: 5, c: 17, d: 1, e: 9, f: 12, g: 13, h: 14, i: 15 }
// "# // "#
// ), // ),
// (3, 5, 17, 1, 9, 12, 13, 14, 15), // (3, 5, 17, 1, 9, 12, 13, 14, 15),
// (i64, i64, i64, i64, i64, i64, i64, i64, i64) // (i64, i64, i64, i64, i64, i64, i64, i64, i64)
// ); // );
// } // }
// #[test] // #[test]
// fn f64_record3_literal() { // fn f64_record3_literal() {
// assert_evals_to!( // assert_evals_to!(
// indoc!( // indoc!(
// r#" // r#"
// { x: 3.1, y: 5.1, z: 17.1 } // { x: 3.1, y: 5.1, z: 17.1 }
// "# // "#
// ), // ),
// (3.1, 5.1, 17.1), // (3.1, 5.1, 17.1),
// (f64, f64, f64) // (f64, f64, f64)
// ); // );
// } // }
#[test] #[test]
fn bool_literal() { fn bool_literal() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -382,10 +373,10 @@ mod gen_records {
true, true,
bool bool
); );
} }
#[test] #[test]
fn return_record() { fn return_record() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -398,10 +389,10 @@ mod gen_records {
(4, 3), (4, 3),
(i64, i64) (i64, i64)
); );
} }
#[test] #[test]
fn optional_field_when_use_default() { fn optional_field_when_use_default() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -425,10 +416,10 @@ mod gen_records {
3 * 5 * 7 * 11, 3 * 5 * 7 * 11,
i64 i64
); );
} }
#[test] #[test]
fn optional_field_when_use_default_nested() { fn optional_field_when_use_default_nested() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -448,10 +439,10 @@ mod gen_records {
3 * 5 * 7 * 11, 3 * 5 * 7 * 11,
i64 i64
); );
} }
#[test] #[test]
fn optional_field_when_no_use_default() { fn optional_field_when_no_use_default() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -468,10 +459,10 @@ mod gen_records {
13, 13,
i64 i64
); );
} }
#[test] #[test]
fn optional_field_when_no_use_default_nested() { fn optional_field_when_no_use_default_nested() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -485,10 +476,10 @@ mod gen_records {
13, 13,
i64 i64
); );
} }
#[test] #[test]
fn optional_field_let_use_default() { fn optional_field_let_use_default() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -505,10 +496,10 @@ mod gen_records {
19, 19,
i64 i64
); );
} }
#[test] #[test]
fn optional_field_let_no_use_default() { fn optional_field_let_no_use_default() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -525,10 +516,10 @@ mod gen_records {
13, 13,
i64 i64
); );
} }
#[test] #[test]
fn optional_field_let_no_use_default_nested() { fn optional_field_let_no_use_default_nested() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -542,10 +533,10 @@ mod gen_records {
13, 13,
i64 i64
); );
} }
#[test] #[test]
fn optional_field_function_use_default() { fn optional_field_function_use_default() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -558,11 +549,11 @@ mod gen_records {
19, 19,
i64 i64
); );
} }
#[test] #[test]
#[ignore] #[ignore]
fn optional_field_function_no_use_default() { fn optional_field_function_no_use_default() {
// blocked on https://github.com/rtfeldman/roc/issues/786 // blocked on https://github.com/rtfeldman/roc/issues/786
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
@ -578,11 +569,11 @@ mod gen_records {
13, 13,
i64 i64
); );
} }
#[test] #[test]
#[ignore] #[ignore]
fn optional_field_function_no_use_default_nested() { fn optional_field_function_no_use_default_nested() {
// blocked on https://github.com/rtfeldman/roc/issues/786 // blocked on https://github.com/rtfeldman/roc/issues/786
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
@ -596,10 +587,10 @@ mod gen_records {
13, 13,
i64 i64
); );
} }
#[test] #[test]
fn optional_field_singleton_record() { fn optional_field_singleton_record() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -610,10 +601,10 @@ mod gen_records {
4, 4,
i64 i64
); );
} }
#[test] #[test]
fn optional_field_empty_record() { fn optional_field_empty_record() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -624,10 +615,10 @@ mod gen_records {
3, 3,
i64 i64
); );
} }
#[test] #[test]
fn return_record_2() { fn return_record_2() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -637,10 +628,10 @@ mod gen_records {
[3, 5], [3, 5],
[i64; 2] [i64; 2]
); );
} }
#[test] #[test]
fn return_record_3() { fn return_record_3() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -650,10 +641,10 @@ mod gen_records {
(3, 5, 4), (3, 5, 4),
(i64, i64, i64) (i64, i64, i64)
); );
} }
#[test] #[test]
fn return_record_4() { fn return_record_4() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -663,10 +654,10 @@ mod gen_records {
[3, 5, 4, 2], [3, 5, 4, 2],
[i64; 4] [i64; 4]
); );
} }
#[test] #[test]
fn return_record_5() { fn return_record_5() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -676,10 +667,10 @@ mod gen_records {
[3, 5, 4, 2, 1], [3, 5, 4, 2, 1],
[i64; 5] [i64; 5]
); );
} }
#[test] #[test]
fn return_record_6() { fn return_record_6() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -689,10 +680,10 @@ mod gen_records {
[3, 5, 4, 2, 1, 7], [3, 5, 4, 2, 1, 7],
[i64; 6] [i64; 6]
); );
} }
#[test] #[test]
fn return_record_7() { fn return_record_7() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -702,10 +693,10 @@ mod gen_records {
[3, 5, 4, 2, 1, 7, 8], [3, 5, 4, 2, 1, 7, 8],
[i64; 7] [i64; 7]
); );
} }
#[test] #[test]
fn return_record_float_int() { fn return_record_float_int() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -715,10 +706,10 @@ mod gen_records {
(3.14, 0x1), (3.14, 0x1),
(f64, i64) (f64, i64)
); );
} }
#[test] #[test]
fn return_record_int_float() { fn return_record_int_float() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -728,10 +719,10 @@ mod gen_records {
(0x1, 3.14), (0x1, 3.14),
(i64, f64) (i64, f64)
); );
} }
#[test] #[test]
fn return_record_float_float() { fn return_record_float_float() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -741,10 +732,10 @@ mod gen_records {
(6.28, 3.14), (6.28, 3.14),
(f64, f64) (f64, f64)
); );
} }
#[test] #[test]
fn return_record_float_float_float() { fn return_record_float_float_float() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -754,10 +745,10 @@ mod gen_records {
(6.28, 3.14, 0.1), (6.28, 3.14, 0.1),
(f64, f64, f64) (f64, f64, f64)
); );
} }
#[test] #[test]
fn return_nested_record() { fn return_nested_record() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -767,10 +758,10 @@ mod gen_records {
(0x0, (6.28, 3.14, 0.1)), (0x0, (6.28, 3.14, 0.1)),
(i64, (f64, f64, f64)) (i64, (f64, f64, f64))
); );
} }
#[test] #[test]
fn accessor() { fn accessor() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -780,10 +771,10 @@ mod gen_records {
7, 7,
i64 i64
); );
} }
#[test] #[test]
fn accessor_single_element_record() { fn accessor_single_element_record() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -793,10 +784,10 @@ mod gen_records {
4, 4,
i64 i64
); );
} }
#[test] #[test]
fn update_record() { fn update_record() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -808,10 +799,10 @@ mod gen_records {
(6.28, 43), (6.28, 43),
(f64, i64) (f64, i64)
); );
} }
#[test] #[test]
fn update_single_element_record() { fn update_single_element_record() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -823,10 +814,10 @@ mod gen_records {
43, 43,
i64 i64
); );
} }
#[test] #[test]
fn booleans_in_record() { fn booleans_in_record() {
assert_evals_to!( assert_evals_to!(
indoc!("{ x: 1 == 1, y: 1 == 1 }"), indoc!("{ x: 1 == 1, y: 1 == 1 }"),
(true, true), (true, true),
@ -847,19 +838,19 @@ mod gen_records {
(false, false), (false, false),
(bool, bool) (bool, bool)
); );
} }
#[test] #[test]
fn alignment_in_record() { fn alignment_in_record() {
assert_evals_to!( assert_evals_to!(
indoc!("{ c: 32, b: if True then Red else if True then Green else Blue, a: 1 == 1 }"), indoc!("{ c: 32, b: if True then Red else if True then Green else Blue, a: 1 == 1 }"),
(32i64, true, 2u8), (32i64, true, 2u8),
(i64, bool, u8) (i64, bool, u8)
); );
} }
#[test] #[test]
fn blue_and_present() { fn blue_and_present() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -874,10 +865,10 @@ mod gen_records {
7, 7,
i64 i64
); );
} }
#[test] #[test]
fn blue_and_absent() { fn blue_and_absent() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -892,5 +883,4 @@ mod gen_records {
3, 3,
i64 i64
); );
}
} }

View file

@ -1,21 +1,11 @@
#[macro_use] #![cfg(test)]
extern crate pretty_assertions;
#[macro_use]
extern crate indoc;
extern crate bumpalo; use crate::assert_evals_to;
extern crate inkwell; use crate::assert_llvm_evals_to;
extern crate libc; use indoc::indoc;
extern crate roc_gen;
#[macro_use] #[test]
mod helpers; fn with_default() {
#[cfg(test)]
mod gen_result {
#[test]
fn with_default() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -41,10 +31,10 @@ mod gen_result {
0, 0,
i64 i64
); );
} }
#[test] #[test]
fn result_map() { fn result_map() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -74,10 +64,10 @@ mod gen_result {
0, 0,
i64 i64
); );
} }
#[test] #[test]
fn result_map_err() { fn result_map_err() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -107,5 +97,4 @@ mod gen_result {
0, 0,
i64 i64
); );
}
} }

View file

@ -1,21 +1,11 @@
#[macro_use] #![cfg(test)]
extern crate pretty_assertions;
#[macro_use]
extern crate indoc;
extern crate bumpalo; use crate::assert_evals_to;
extern crate inkwell; use crate::assert_llvm_evals_to;
extern crate libc; use indoc::indoc;
extern crate roc_gen;
#[macro_use] #[test]
mod helpers; fn empty_len() {
#[cfg(test)]
mod gen_set {
#[test]
fn empty_len() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -25,10 +15,10 @@ mod gen_set {
0, 0,
usize usize
); );
} }
#[test] #[test]
fn singleton_len() { fn singleton_len() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -38,10 +28,10 @@ mod gen_set {
1, 1,
usize usize
); );
} }
#[test] #[test]
fn singleton_to_list() { fn singleton_to_list() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -71,10 +61,10 @@ mod gen_set {
&[1.0], &[1.0],
&[f64] &[f64]
); );
} }
#[test] #[test]
fn insert() { fn insert() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -88,10 +78,10 @@ mod gen_set {
&[0, 1, 2], &[0, 1, 2],
&[i64] &[i64]
); );
} }
#[test] #[test]
fn remove() { fn remove() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -106,10 +96,10 @@ mod gen_set {
&[0], &[0],
&[i64] &[i64]
); );
} }
#[test] #[test]
fn union() { fn union() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -126,10 +116,10 @@ mod gen_set {
&[4, 2, 3, 1], &[4, 2, 3, 1],
&[i64] &[i64]
); );
} }
#[test] #[test]
fn difference() { fn difference() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -146,10 +136,10 @@ mod gen_set {
&[2], &[2],
&[i64] &[i64]
); );
} }
#[test] #[test]
fn intersection() { fn intersection() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -166,10 +156,10 @@ mod gen_set {
&[1], &[1],
&[i64] &[i64]
); );
} }
#[test] #[test]
fn walk_sum() { fn walk_sum() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -179,10 +169,10 @@ mod gen_set {
6, 6,
i64 i64
); );
} }
#[test] #[test]
fn contains() { fn contains() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -202,10 +192,10 @@ mod gen_set {
false, false,
bool bool
); );
} }
#[test] #[test]
fn from_list() { fn from_list() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -244,5 +234,4 @@ mod gen_set {
&[], &[],
&[i64] &[i64]
); );
}
} }

View file

@ -1,27 +1,14 @@
#[macro_use] #![cfg(test)]
extern crate pretty_assertions;
#[macro_use]
extern crate indoc;
extern crate bumpalo;
extern crate inkwell;
extern crate libc;
extern crate roc_gen;
use crate::assert_evals_to;
use crate::assert_llvm_evals_to;
use indoc::indoc;
use roc_std::RocStr; use roc_std::RocStr;
use std::cmp::min;
#[macro_use]
mod helpers;
const ROC_STR_MEM_SIZE: usize = core::mem::size_of::<RocStr>(); const ROC_STR_MEM_SIZE: usize = core::mem::size_of::<RocStr>();
#[cfg(test)] fn small_str(str: &str) -> [u8; ROC_STR_MEM_SIZE] {
mod gen_str {
use crate::ROC_STR_MEM_SIZE;
use roc_std::RocStr;
use std::cmp::min;
fn small_str(str: &str) -> [u8; ROC_STR_MEM_SIZE] {
let mut bytes: [u8; ROC_STR_MEM_SIZE] = Default::default(); let mut bytes: [u8; ROC_STR_MEM_SIZE] = Default::default();
let mut index: usize = 0; let mut index: usize = 0;
@ -42,10 +29,10 @@ mod gen_str {
bytes[ROC_STR_MEM_SIZE - 1] = 0b1000_0000 ^ (output_len as u8); bytes[ROC_STR_MEM_SIZE - 1] = 0b1000_0000 ^ (output_len as u8);
bytes bytes
} }
#[test] #[test]
fn str_split_bigger_delimiter_small_str() { fn str_split_bigger_delimiter_small_str() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -71,10 +58,10 @@ mod gen_str {
3, 3,
i64 i64
); );
} }
#[test] #[test]
fn str_split_str_concat_repeated() { fn str_split_str_concat_repeated() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -94,10 +81,10 @@ mod gen_str {
"JJJJJJJJJJJJJJJJJJJJJJJJJ", "JJJJJJJJJJJJJJJJJJJJJJJJJ",
&'static str &'static str
); );
} }
#[test] #[test]
fn str_split_small_str_bigger_delimiter() { fn str_split_small_str_bigger_delimiter() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -112,10 +99,10 @@ mod gen_str {
small_str("JJJ"), small_str("JJJ"),
[u8; ROC_STR_MEM_SIZE] [u8; ROC_STR_MEM_SIZE]
); );
} }
#[test] #[test]
fn str_split_big_str_small_delimiter() { fn str_split_big_str_small_delimiter() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -135,10 +122,10 @@ mod gen_str {
&["01234567789abcdefghi ", " 01234567789abcdefghi"], &["01234567789abcdefghi ", " 01234567789abcdefghi"],
&'static [&'static str] &'static [&'static str]
); );
} }
#[test] #[test]
fn str_split_small_str_small_delimiter() { fn str_split_small_str_small_delimiter() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -148,10 +135,10 @@ mod gen_str {
&[small_str("J"), small_str("J"), small_str("J")], &[small_str("J"), small_str("J"), small_str("J")],
&'static [[u8; ROC_STR_MEM_SIZE]] &'static [[u8; ROC_STR_MEM_SIZE]]
); );
} }
#[test] #[test]
fn str_split_bigger_delimiter_big_strs() { fn str_split_bigger_delimiter_big_strs() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -163,10 +150,10 @@ mod gen_str {
&["string to split is shorter"], &["string to split is shorter"],
&'static [&'static str] &'static [&'static str]
); );
} }
#[test] #[test]
fn str_split_empty_strs() { fn str_split_empty_strs() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -176,10 +163,10 @@ mod gen_str {
&[small_str("")], &[small_str("")],
&'static [[u8; ROC_STR_MEM_SIZE]] &'static [[u8; ROC_STR_MEM_SIZE]]
) )
} }
#[test] #[test]
fn str_split_minimal_example() { fn str_split_minimal_example() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -189,10 +176,10 @@ mod gen_str {
&[small_str("a"), small_str("")], &[small_str("a"), small_str("")],
&'static [[u8; ROC_STR_MEM_SIZE]] &'static [[u8; ROC_STR_MEM_SIZE]]
) )
} }
#[test] #[test]
fn str_split_small_str_big_delimiter() { fn str_split_small_str_big_delimiter() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -217,10 +204,10 @@ mod gen_str {
&[small_str("1"), small_str("2"), small_str("")], &[small_str("1"), small_str("2"), small_str("")],
&'static [[u8; ROC_STR_MEM_SIZE]] &'static [[u8; ROC_STR_MEM_SIZE]]
); );
} }
#[test] #[test]
fn str_split_small_str_20_char_delimiter() { fn str_split_small_str_20_char_delimiter() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -232,10 +219,10 @@ mod gen_str {
&[small_str("3"), small_str("4"), small_str("")], &[small_str("3"), small_str("4"), small_str("")],
&'static [[u8; ROC_STR_MEM_SIZE]] &'static [[u8; ROC_STR_MEM_SIZE]]
); );
} }
#[test] #[test]
fn str_concat_big_to_big() { fn str_concat_big_to_big() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -247,10 +234,10 @@ mod gen_str {
"First string that is fairly long. Longer strings make for different errors. Second string that is also fairly long. Two long strings test things that might not appear with short strings.", "First string that is fairly long. Longer strings make for different errors. Second string that is also fairly long. Two long strings test things that might not appear with short strings.",
&'static str &'static str
); );
} }
#[test] #[test]
fn small_str_literal() { fn small_str_literal() {
assert_evals_to!( assert_evals_to!(
"\"JJJJJJJJJJJJJJJ\"", "\"JJJJJJJJJJJJJJJ\"",
[ [
@ -273,10 +260,10 @@ mod gen_str {
], ],
[u8; 16] [u8; 16]
); );
} }
#[test] #[test]
fn small_str_zeroed_literal() { fn small_str_zeroed_literal() {
// Verifies that we zero out unused bytes in the string. // Verifies that we zero out unused bytes in the string.
// This is important so that string equality tests don't randomly // This is important so that string equality tests don't randomly
// fail due to unused memory being there! // fail due to unused memory being there!
@ -302,10 +289,10 @@ mod gen_str {
], ],
[u8; 16] [u8; 16]
); );
} }
#[test] #[test]
fn small_str_concat_empty_first_arg() { fn small_str_concat_empty_first_arg() {
assert_evals_to!( assert_evals_to!(
r#"Str.concat "" "JJJJJJJJJJJJJJJ""#, r#"Str.concat "" "JJJJJJJJJJJJJJJ""#,
[ [
@ -328,10 +315,10 @@ mod gen_str {
], ],
[u8; 16] [u8; 16]
); );
} }
#[test] #[test]
fn small_str_concat_empty_second_arg() { fn small_str_concat_empty_second_arg() {
assert_evals_to!( assert_evals_to!(
r#"Str.concat "JJJJJJJJJJJJJJJ" """#, r#"Str.concat "JJJJJJJJJJJJJJJ" """#,
[ [
@ -354,19 +341,19 @@ mod gen_str {
], ],
[u8; 16] [u8; 16]
); );
} }
#[test] #[test]
fn small_str_concat_small_to_big() { fn small_str_concat_small_to_big() {
assert_evals_to!( assert_evals_to!(
r#"Str.concat "abc" " this is longer than 15 chars""#, r#"Str.concat "abc" " this is longer than 15 chars""#,
"abc this is longer than 15 chars", "abc this is longer than 15 chars",
&'static str &'static str
); );
} }
#[test] #[test]
fn small_str_concat_small_to_small_staying_small() { fn small_str_concat_small_to_small_staying_small() {
assert_evals_to!( assert_evals_to!(
r#"Str.concat "J" "JJJJJJJJJJJJJJ""#, r#"Str.concat "J" "JJJJJJJJJJJJJJ""#,
[ [
@ -389,110 +376,110 @@ mod gen_str {
], ],
[u8; 16] [u8; 16]
); );
} }
#[test] #[test]
fn small_str_concat_small_to_small_overflow_to_big() { fn small_str_concat_small_to_small_overflow_to_big() {
assert_evals_to!( assert_evals_to!(
r#"Str.concat "abcdefghijklm" "nopqrstuvwxyz""#, r#"Str.concat "abcdefghijklm" "nopqrstuvwxyz""#,
"abcdefghijklmnopqrstuvwxyz", "abcdefghijklmnopqrstuvwxyz",
&'static str &'static str
); );
} }
#[test] #[test]
fn str_concat_empty() { fn str_concat_empty() {
assert_evals_to!(r#"Str.concat "" """#, "", &'static str); assert_evals_to!(r#"Str.concat "" """#, "", &'static str);
} }
#[test] #[test]
fn small_str_is_empty() { fn small_str_is_empty() {
assert_evals_to!(r#"Str.isEmpty "abc""#, false, bool); assert_evals_to!(r#"Str.isEmpty "abc""#, false, bool);
} }
#[test] #[test]
fn big_str_is_empty() { fn big_str_is_empty() {
assert_evals_to!( assert_evals_to!(
r#"Str.isEmpty "this is more than 15 chars long""#, r#"Str.isEmpty "this is more than 15 chars long""#,
false, false,
bool bool
); );
} }
#[test] #[test]
fn empty_str_is_empty() { fn empty_str_is_empty() {
assert_evals_to!(r#"Str.isEmpty """#, true, bool); assert_evals_to!(r#"Str.isEmpty """#, true, bool);
} }
#[test] #[test]
fn str_starts_with() { fn str_starts_with() {
assert_evals_to!(r#"Str.startsWith "hello world" "hell""#, true, bool); assert_evals_to!(r#"Str.startsWith "hello world" "hell""#, true, bool);
assert_evals_to!(r#"Str.startsWith "hello world" """#, true, bool); assert_evals_to!(r#"Str.startsWith "hello world" """#, true, bool);
assert_evals_to!(r#"Str.startsWith "nope" "hello world""#, false, bool); assert_evals_to!(r#"Str.startsWith "nope" "hello world""#, false, bool);
assert_evals_to!(r#"Str.startsWith "hell" "hello world""#, false, bool); assert_evals_to!(r#"Str.startsWith "hell" "hello world""#, false, bool);
assert_evals_to!(r#"Str.startsWith "" "hello world""#, false, bool); assert_evals_to!(r#"Str.startsWith "" "hello world""#, false, bool);
} }
#[test] #[test]
fn str_ends_with() { fn str_ends_with() {
assert_evals_to!(r#"Str.endsWith "hello world" "world""#, true, bool); assert_evals_to!(r#"Str.endsWith "hello world" "world""#, true, bool);
assert_evals_to!(r#"Str.endsWith "nope" "hello world""#, false, bool); assert_evals_to!(r#"Str.endsWith "nope" "hello world""#, false, bool);
assert_evals_to!(r#"Str.endsWith "" "hello world""#, false, bool); assert_evals_to!(r#"Str.endsWith "" "hello world""#, false, bool);
} }
#[test] #[test]
fn str_count_graphemes_small_str() { fn str_count_graphemes_small_str() {
assert_evals_to!(r#"Str.countGraphemes "å🤔""#, 2, usize); assert_evals_to!(r#"Str.countGraphemes "å🤔""#, 2, usize);
} }
#[test] #[test]
fn str_count_graphemes_three_js() { fn str_count_graphemes_three_js() {
assert_evals_to!(r#"Str.countGraphemes "JJJ""#, 3, usize); assert_evals_to!(r#"Str.countGraphemes "JJJ""#, 3, usize);
} }
#[test] #[test]
fn str_count_graphemes_big_str() { fn str_count_graphemes_big_str() {
assert_evals_to!( assert_evals_to!(
r#"Str.countGraphemes "6🤔å🤔e¥🤔çppkd🙃1jdal🦯asdfa∆ltråø˚waia8918.,🏅jjc""#, r#"Str.countGraphemes "6🤔å🤔e¥🤔çppkd🙃1jdal🦯asdfa∆ltråø˚waia8918.,🏅jjc""#,
45, 45,
usize usize
); );
} }
#[test] #[test]
fn str_starts_with_same_big_str() { fn str_starts_with_same_big_str() {
assert_evals_to!( assert_evals_to!(
r#"Str.startsWith "123456789123456789" "123456789123456789""#, r#"Str.startsWith "123456789123456789" "123456789123456789""#,
true, true,
bool bool
); );
} }
#[test] #[test]
fn str_starts_with_different_big_str() { fn str_starts_with_different_big_str() {
assert_evals_to!( assert_evals_to!(
r#"Str.startsWith "12345678912345678910" "123456789123456789""#, r#"Str.startsWith "12345678912345678910" "123456789123456789""#,
true, true,
bool bool
); );
} }
#[test] #[test]
fn str_starts_with_same_small_str() { fn str_starts_with_same_small_str() {
assert_evals_to!(r#"Str.startsWith "1234" "1234""#, true, bool); assert_evals_to!(r#"Str.startsWith "1234" "1234""#, true, bool);
} }
#[test] #[test]
fn str_starts_with_different_small_str() { fn str_starts_with_different_small_str() {
assert_evals_to!(r#"Str.startsWith "1234" "12""#, true, bool); assert_evals_to!(r#"Str.startsWith "1234" "12""#, true, bool);
} }
#[test] #[test]
fn str_starts_with_false_small_str() { fn str_starts_with_false_small_str() {
assert_evals_to!(r#"Str.startsWith "1234" "23""#, false, bool); assert_evals_to!(r#"Str.startsWith "1234" "23""#, false, bool);
} }
#[test] #[test]
fn str_from_int() { fn str_from_int() {
assert_evals_to!( assert_evals_to!(
r#"Str.fromInt 1234"#, r#"Str.fromInt 1234"#,
roc_std::RocStr::from_slice("1234".as_bytes()), roc_std::RocStr::from_slice("1234".as_bytes()),
@ -514,10 +501,10 @@ mod gen_str {
let min = format!("{}", i64::MIN); let min = format!("{}", i64::MIN);
assert_evals_to!(r#"Str.fromInt Num.minInt"#, &min, &'static str); assert_evals_to!(r#"Str.fromInt Num.minInt"#, &min, &'static str);
} }
#[test] #[test]
fn str_from_utf8_pass_single_ascii() { fn str_from_utf8_pass_single_ascii() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -529,10 +516,10 @@ mod gen_str {
roc_std::RocStr::from_slice("a".as_bytes()), roc_std::RocStr::from_slice("a".as_bytes()),
roc_std::RocStr roc_std::RocStr
); );
} }
#[test] #[test]
fn str_from_utf8_pass_many_ascii() { fn str_from_utf8_pass_many_ascii() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -544,10 +531,10 @@ mod gen_str {
roc_std::RocStr::from_slice("abc~".as_bytes()), roc_std::RocStr::from_slice("abc~".as_bytes()),
roc_std::RocStr roc_std::RocStr
); );
} }
#[test] #[test]
fn str_from_utf8_pass_single_unicode() { fn str_from_utf8_pass_single_unicode() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -559,10 +546,10 @@ mod gen_str {
roc_std::RocStr::from_slice("".as_bytes()), roc_std::RocStr::from_slice("".as_bytes()),
roc_std::RocStr roc_std::RocStr
); );
} }
#[test] #[test]
fn str_from_utf8_pass_many_unicode() { fn str_from_utf8_pass_many_unicode() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -574,10 +561,10 @@ mod gen_str {
roc_std::RocStr::from_slice("∆œ¬".as_bytes()), roc_std::RocStr::from_slice("∆œ¬".as_bytes()),
roc_std::RocStr roc_std::RocStr
); );
} }
#[test] #[test]
fn str_from_utf8_pass_single_grapheme() { fn str_from_utf8_pass_single_grapheme() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -589,10 +576,10 @@ mod gen_str {
roc_std::RocStr::from_slice("💖".as_bytes()), roc_std::RocStr::from_slice("💖".as_bytes()),
roc_std::RocStr roc_std::RocStr
); );
} }
#[test] #[test]
fn str_from_utf8_pass_many_grapheme() { fn str_from_utf8_pass_many_grapheme() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -604,10 +591,10 @@ mod gen_str {
roc_std::RocStr::from_slice("💖🤠🚀".as_bytes()), roc_std::RocStr::from_slice("💖🤠🚀".as_bytes()),
roc_std::RocStr roc_std::RocStr
); );
} }
#[test] #[test]
fn str_from_utf8_pass_all() { fn str_from_utf8_pass_all() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -619,10 +606,10 @@ mod gen_str {
roc_std::RocStr::from_slice("💖b∆".as_bytes()), roc_std::RocStr::from_slice("💖b∆".as_bytes()),
roc_std::RocStr roc_std::RocStr
); );
} }
#[test] #[test]
fn str_from_utf8_fail_invalid_start_byte() { fn str_from_utf8_fail_invalid_start_byte() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -638,10 +625,10 @@ mod gen_str {
roc_std::RocStr::from_slice("a".as_bytes()), roc_std::RocStr::from_slice("a".as_bytes()),
roc_std::RocStr roc_std::RocStr
); );
} }
#[test] #[test]
fn str_from_utf8_fail_unexpected_end_of_sequence() { fn str_from_utf8_fail_unexpected_end_of_sequence() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -657,10 +644,10 @@ mod gen_str {
roc_std::RocStr::from_slice("a".as_bytes()), roc_std::RocStr::from_slice("a".as_bytes()),
roc_std::RocStr roc_std::RocStr
); );
} }
#[test] #[test]
fn str_from_utf8_fail_expected_continuation() { fn str_from_utf8_fail_expected_continuation() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -676,10 +663,10 @@ mod gen_str {
roc_std::RocStr::from_slice("a".as_bytes()), roc_std::RocStr::from_slice("a".as_bytes()),
roc_std::RocStr roc_std::RocStr
); );
} }
#[test] #[test]
fn str_from_utf8_fail_overlong_encoding() { fn str_from_utf8_fail_overlong_encoding() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -695,10 +682,10 @@ mod gen_str {
roc_std::RocStr::from_slice("a".as_bytes()), roc_std::RocStr::from_slice("a".as_bytes()),
roc_std::RocStr roc_std::RocStr
); );
} }
#[test] #[test]
fn str_from_utf8_fail_codepoint_too_large() { fn str_from_utf8_fail_codepoint_too_large() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -714,10 +701,10 @@ mod gen_str {
roc_std::RocStr::from_slice("a".as_bytes()), roc_std::RocStr::from_slice("a".as_bytes()),
roc_std::RocStr roc_std::RocStr
); );
} }
#[test] #[test]
fn str_from_utf8_fail_surrogate_half() { fn str_from_utf8_fail_surrogate_half() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -733,10 +720,10 @@ mod gen_str {
roc_std::RocStr::from_slice("a".as_bytes()), roc_std::RocStr::from_slice("a".as_bytes()),
roc_std::RocStr roc_std::RocStr
); );
} }
#[test] #[test]
fn str_equality() { fn str_equality() {
assert_evals_to!(r#""a" == "a""#, true, bool); assert_evals_to!(r#""a" == "a""#, true, bool);
assert_evals_to!( assert_evals_to!(
r#""loremipsumdolarsitamet" == "loremipsumdolarsitamet""#, r#""loremipsumdolarsitamet" == "loremipsumdolarsitamet""#,
@ -745,10 +732,10 @@ mod gen_str {
); );
assert_evals_to!(r#""a" != "b""#, true, bool); assert_evals_to!(r#""a" != "b""#, true, bool);
assert_evals_to!(r#""a" == "b""#, false, bool); assert_evals_to!(r#""a" == "b""#, false, bool);
} }
#[test] #[test]
fn str_clone() { fn str_clone() {
use roc_std::RocStr; use roc_std::RocStr;
let long = RocStr::from_slice("loremipsumdolarsitamet".as_bytes()); let long = RocStr::from_slice("loremipsumdolarsitamet".as_bytes());
let short = RocStr::from_slice("x".as_bytes()); let short = RocStr::from_slice("x".as_bytes());
@ -757,10 +744,10 @@ mod gen_str {
debug_assert_eq!(long.clone(), long); debug_assert_eq!(long.clone(), long);
debug_assert_eq!(short.clone(), short); debug_assert_eq!(short.clone(), short);
debug_assert_eq!(empty.clone(), empty); debug_assert_eq!(empty.clone(), empty);
} }
#[test] #[test]
fn nested_recursive_literal() { fn nested_recursive_literal() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -787,46 +774,45 @@ mod gen_str {
"Add (Add (Val 3) (Val 1)) (Add (Val 1) (Var 1))", "Add (Add (Val 3) (Val 1)) (Add (Val 1) (Var 1))",
&'static str &'static str
); );
} }
#[test] #[test]
fn str_join_comma_small() { fn str_join_comma_small() {
assert_evals_to!( assert_evals_to!(
r#"Str.joinWith ["1", "2"] ", " "#, r#"Str.joinWith ["1", "2"] ", " "#,
RocStr::from("1, 2"), RocStr::from("1, 2"),
RocStr RocStr
); );
} }
#[test] #[test]
fn str_join_comma_big() { fn str_join_comma_big() {
assert_evals_to!( assert_evals_to!(
r#"Str.joinWith ["10000000", "2000000", "30000000"] ", " "#, r#"Str.joinWith ["10000000", "2000000", "30000000"] ", " "#,
RocStr::from("10000000, 2000000, 30000000"), RocStr::from("10000000, 2000000, 30000000"),
RocStr RocStr
); );
} }
#[test] #[test]
fn str_join_comma_single() { fn str_join_comma_single() {
assert_evals_to!(r#"Str.joinWith ["1"] ", " "#, RocStr::from("1"), RocStr); assert_evals_to!(r#"Str.joinWith ["1"] ", " "#, RocStr::from("1"), RocStr);
} }
#[test] #[test]
fn str_from_float() { fn str_from_float() {
assert_evals_to!(r#"Str.fromFloat 3.14"#, RocStr::from("3.140000"), RocStr); assert_evals_to!(r#"Str.fromFloat 3.14"#, RocStr::from("3.140000"), RocStr);
} }
#[test] #[test]
fn str_to_bytes() { fn str_to_bytes() {
assert_evals_to!(r#"Str.toBytes "hello""#, &[104, 101, 108, 108, 111], &[u8]); assert_evals_to!(r#"Str.toBytes "hello""#, &[104, 101, 108, 108, 111], &[u8]);
assert_evals_to!( assert_evals_to!(
r#"Str.toBytes "this is a long string""#, r#"Str.toBytes "this is a long string""#,
&[ &[
116, 104, 105, 115, 32, 105, 115, 32, 97, 32, 108, 111, 110, 103, 32, 115, 116, 116, 104, 105, 115, 32, 105, 115, 32, 97, 32, 108, 111, 110, 103, 32, 115, 116, 114,
114, 105, 110, 103 105, 110, 103
], ],
&[u8] &[u8]
); );
}
} }

View file

@ -1,17 +1,11 @@
extern crate bumpalo; #![cfg(test)]
extern crate inkwell;
extern crate libc;
extern crate roc_gen;
#[cfg(test)] use crate::assert_evals_to;
mod gen_tags { use crate::assert_llvm_evals_to;
#[macro_use] use indoc::indoc;
use crate::assert_evals_to;
use crate::assert_llvm_evals_to;
use indoc::indoc;
#[test] #[test]
fn applied_tag_nothing_ir() { fn applied_tag_nothing_ir() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -27,10 +21,10 @@ mod gen_tags {
(i64, i64), (i64, i64),
|(tag, _)| tag |(tag, _)| tag
); );
} }
#[test] #[test]
fn applied_tag_nothing() { fn applied_tag_nothing() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -46,10 +40,10 @@ mod gen_tags {
(i64, i64), (i64, i64),
|(tag, _)| tag |(tag, _)| tag
); );
} }
#[test] #[test]
fn applied_tag_just() { fn applied_tag_just() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -64,10 +58,10 @@ mod gen_tags {
(0, 0x4), (0, 0x4),
(i64, i64) (i64, i64)
); );
} }
#[test] #[test]
fn applied_tag_just_ir() { fn applied_tag_just_ir() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -82,10 +76,10 @@ mod gen_tags {
(0, 0x4), (0, 0x4),
(i64, i64) (i64, i64)
); );
} }
#[test] #[test]
fn applied_tag_just_enum() { fn applied_tag_just_enum() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -104,26 +98,26 @@ mod gen_tags {
(0, 2), (0, 2),
(i64, u8) (i64, u8)
); );
} }
// #[test] // #[test]
// fn raw_result() { // fn raw_result() {
// assert_evals_to!( // assert_evals_to!(
// indoc!( // indoc!(
// r#" // r#"
// x : Result I64 I64 // x : Result I64 I64
// x = Err 41 // x = Err 41
// x // x
// "# // "#
// ), // ),
// 0, // 0,
// i8 // i8
// ); // );
// } // }
#[test] #[test]
fn true_is_true() { fn true_is_true() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -136,10 +130,10 @@ mod gen_tags {
true, true,
bool bool
); );
} }
#[test] #[test]
fn false_is_false() { fn false_is_false() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -152,10 +146,10 @@ mod gen_tags {
false, false,
bool bool
); );
} }
#[test] #[test]
fn basic_enum() { fn basic_enum() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -173,67 +167,67 @@ mod gen_tags {
false, false,
bool bool
); );
} }
// #[test] // #[test]
// fn linked_list_empty() { // fn linked_list_empty() {
// assert_evals_to!( // assert_evals_to!(
// indoc!( // indoc!(
// r#" // r#"
// LinkedList a : [ Cons a (LinkedList a), Nil ] // LinkedList a : [ Cons a (LinkedList a), Nil ]
// //
// empty : LinkedList I64 // empty : LinkedList I64
// empty = Nil // empty = Nil
// //
// 1 // 1
// "# // "#
// ), // ),
// 1, // 1,
// i64 // i64
// ); // );
// } // }
// //
// #[test] // #[test]
// fn linked_list_singleton() { // fn linked_list_singleton() {
// assert_evals_to!( // assert_evals_to!(
// indoc!( // indoc!(
// r#" // r#"
// LinkedList a : [ Cons a (LinkedList a), Nil ] // LinkedList a : [ Cons a (LinkedList a), Nil ]
// //
// singleton : LinkedList I64 // singleton : LinkedList I64
// singleton = Cons 0x1 Nil // singleton = Cons 0x1 Nil
// //
// 1 // 1
// "# // "#
// ), // ),
// 1, // 1,
// i64 // i64
// ); // );
// } // }
// //
// #[test] // #[test]
// fn linked_list_is_empty() { // fn linked_list_is_empty() {
// assert_evals_to!( // assert_evals_to!(
// indoc!( // indoc!(
// r#" // r#"
// LinkedList a : [ Cons a (LinkedList a), Nil ] // LinkedList a : [ Cons a (LinkedList a), Nil ]
// //
// isEmpty : LinkedList a -> Bool // isEmpty : LinkedList a -> Bool
// isEmpty = \list -> // isEmpty = \list ->
// when list is // when list is
// Nil -> True // Nil -> True
// Cons _ _ -> False // Cons _ _ -> False
// //
// isEmpty (Cons 4 Nil) // isEmpty (Cons 4 Nil)
// "# // "#
// ), // ),
// false, // false,
// bool // bool
// ); // );
// } // }
#[test] #[test]
fn even_odd() { fn even_odd() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -255,10 +249,10 @@ mod gen_tags {
true, true,
bool bool
); );
} }
#[test] #[test]
fn gen_literal_true() { fn gen_literal_true() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -268,10 +262,10 @@ mod gen_tags {
-1, -1,
i64 i64
); );
} }
#[test] #[test]
fn gen_if_float() { fn gen_if_float() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -281,9 +275,9 @@ mod gen_tags {
-1.0, -1.0,
f64 f64
); );
} }
#[test] #[test]
fn when_on_nothing() { fn when_on_nothing() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -298,10 +292,10 @@ mod gen_tags {
2, 2,
i64 i64
); );
} }
#[test] #[test]
fn when_on_just() { fn when_on_just() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -316,10 +310,10 @@ mod gen_tags {
42, 42,
i64 i64
); );
} }
#[test] #[test]
fn when_on_result() { fn when_on_result() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -334,10 +328,10 @@ mod gen_tags {
42, 42,
i64 i64
); );
} }
#[test] #[test]
fn when_on_these() { fn when_on_these() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -355,10 +349,10 @@ mod gen_tags {
5, 5,
i64 i64
); );
} }
#[test] #[test]
fn match_on_two_values() { fn match_on_two_values() {
// this will produce a Chain internally // this will produce a Chain internally
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
@ -371,10 +365,10 @@ mod gen_tags {
5, 5,
i64 i64
); );
} }
#[test] #[test]
fn pair_with_guard_pattern() { fn pair_with_guard_pattern() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -387,10 +381,10 @@ mod gen_tags {
5, 5,
i64 i64
); );
} }
#[test] #[test]
fn result_with_guard_pattern() { fn result_with_guard_pattern() {
// This test revealed an issue with hashing Test values // This test revealed an issue with hashing Test values
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
@ -407,10 +401,10 @@ mod gen_tags {
2, 2,
i64 i64
); );
} }
#[test] #[test]
fn maybe_is_just() { fn maybe_is_just() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -431,10 +425,10 @@ mod gen_tags {
true, true,
bool bool
); );
} }
#[test] #[test]
fn maybe_is_just_nested() { fn maybe_is_just_nested() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -452,10 +446,10 @@ mod gen_tags {
true, true,
bool bool
); );
} }
#[test] #[test]
fn nested_pattern_match() { fn nested_pattern_match() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -472,9 +466,9 @@ mod gen_tags {
42, 42,
i64 i64
); );
} }
#[test] #[test]
fn if_guard_pattern_false() { fn if_guard_pattern_false() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -489,10 +483,10 @@ mod gen_tags {
42, 42,
i64 i64
); );
} }
#[test] #[test]
fn if_guard_pattern_true() { fn if_guard_pattern_true() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -507,10 +501,10 @@ mod gen_tags {
42, 42,
i64 i64
); );
} }
#[test] #[test]
fn if_guard_exhaustiveness() { fn if_guard_exhaustiveness() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -525,10 +519,10 @@ mod gen_tags {
42, 42,
i64 i64
); );
} }
#[test] #[test]
fn when_on_enum() { fn when_on_enum() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -546,10 +540,10 @@ mod gen_tags {
1, 1,
i64 i64
); );
} }
#[test] #[test]
fn pattern_matching_unit() { fn pattern_matching_unit() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -604,10 +598,10 @@ mod gen_tags {
42, 42,
i64 i64
); );
} }
#[test] #[test]
fn one_element_tag() { fn one_element_tag() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -620,10 +614,10 @@ mod gen_tags {
2, 2,
i64 i64
); );
} }
#[test] #[test]
fn nested_tag_union() { fn nested_tag_union() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -641,9 +635,9 @@ mod gen_tags {
(0, (0, 41)), (0, (0, 41)),
(i64, (i64, i64)) (i64, (i64, i64))
); );
} }
#[test] #[test]
fn unit_type() { fn unit_type() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -658,10 +652,10 @@ mod gen_tags {
(), (),
() ()
); );
} }
#[test] #[test]
fn nested_record_load() { fn nested_record_load() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -675,10 +669,10 @@ mod gen_tags {
5, 5,
i64 i64
); );
} }
#[test] #[test]
fn join_point_if() { fn join_point_if() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -691,10 +685,10 @@ mod gen_tags {
1, 1,
i64 i64
); );
} }
#[test] #[test]
fn join_point_when() { fn join_point_when() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -716,10 +710,10 @@ mod gen_tags {
3.1, 3.1,
f64 f64
); );
} }
#[test] #[test]
fn join_point_with_cond_expr() { fn join_point_with_cond_expr() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -754,10 +748,10 @@ mod gen_tags {
3, 3,
i64 i64
); );
} }
#[test] #[test]
fn alignment_in_single_tag_construction() { fn alignment_in_single_tag_construction() {
assert_evals_to!(indoc!("Three (1 == 1) 32"), (32i64, true), (i64, bool)); assert_evals_to!(indoc!("Three (1 == 1) 32"), (32i64, true), (i64, bool));
assert_evals_to!( assert_evals_to!(
@ -765,10 +759,10 @@ mod gen_tags {
(32i64, true, 2u8), (32i64, true, 2u8),
(i64, bool, u8) (i64, bool, u8)
); );
} }
#[test] #[test]
fn alignment_in_single_tag_pattern_match() { fn alignment_in_single_tag_pattern_match() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r"# r"#
@ -796,10 +790,10 @@ mod gen_tags {
(32i64, true, 2u8), (32i64, true, 2u8),
(i64, bool, u8) (i64, bool, u8)
); );
} }
#[test] #[test]
fn alignment_in_multi_tag_construction() { fn alignment_in_multi_tag_construction() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r"# r"#
@ -826,10 +820,10 @@ mod gen_tags {
(1, 32i64, true, 2u8), (1, 32i64, true, 2u8),
(i64, i64, bool, u8) (i64, i64, bool, u8)
); );
} }
#[test] #[test]
fn alignment_in_multi_tag_pattern_match() { fn alignment_in_multi_tag_pattern_match() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r"# r"#
@ -864,11 +858,11 @@ mod gen_tags {
(32i64, true, 2u8), (32i64, true, 2u8),
(i64, bool, u8) (i64, bool, u8)
); );
} }
#[test] #[test]
#[ignore] #[ignore]
fn phantom_polymorphic() { fn phantom_polymorphic() {
// see https://github.com/rtfeldman/roc/issues/786 and below // see https://github.com/rtfeldman/roc/issues/786 and below
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
@ -889,11 +883,11 @@ mod gen_tags {
(0, 0), (0, 0),
(i64, i64) (i64, i64)
); );
} }
#[test] #[test]
#[ignore] #[ignore]
fn phantom_polymorphic_record() { fn phantom_polymorphic_record() {
// see https://github.com/rtfeldman/roc/issues/786 // see https://github.com/rtfeldman/roc/issues/786
// also seemed to hit an issue where we check whether `add` // also seemed to hit an issue where we check whether `add`
// has a Closure layout while the type is not fully specialized yet // has a Closure layout while the type is not fully specialized yet
@ -916,10 +910,10 @@ mod gen_tags {
(0, 0), (0, 0),
(i64, i64) (i64, i64)
); );
} }
#[test] #[test]
fn result_never() { fn result_never() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r"# r"#
@ -937,10 +931,10 @@ mod gen_tags {
4, 4,
i64 i64
); );
} }
#[test] #[test]
fn nested_recursive_literal() { fn nested_recursive_literal() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r"# r"#
@ -956,10 +950,10 @@ mod gen_tags {
&i64, &i64,
|x: &i64| *x |x: &i64| *x
); );
} }
#[test] #[test]
fn newtype_wrapper() { fn newtype_wrapper() {
assert_evals_to!( assert_evals_to!(
indoc!( indoc!(
r#" r#"
@ -979,5 +973,4 @@ mod gen_tags {
&i64, &i64,
|x: &i64| *x |x: &i64| *x
); );
}
} }

View file

@ -29,6 +29,9 @@ pub fn test_builtin_defs(symbol: Symbol, var_store: &mut VarStore) -> Option<Def
} }
} }
// this is not actually dead code, but only used by cfg_test modules
// so "normally" it is dead, only at testing time is it used
#[allow(dead_code)]
pub fn helper<'a>( pub fn helper<'a>(
arena: &'a bumpalo::Bump, arena: &'a bumpalo::Bump,
src: &str, src: &str,

View file

@ -4,6 +4,14 @@
// we actually want to compare against the literal float bits // we actually want to compare against the literal float bits
#![allow(clippy::clippy::float_cmp)] #![allow(clippy::clippy::float_cmp)]
pub mod gen_tags; pub mod gen_dict;
pub mod gen_hash;
pub mod gen_list;
pub mod gen_num;
pub mod gen_primitives; pub mod gen_primitives;
pub mod gen_records;
pub mod gen_result;
pub mod gen_set;
pub mod gen_str;
pub mod gen_tags;
mod helpers; mod helpers;