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,18 +1,8 @@
#[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]
mod helpers;
#[cfg(test)]
mod gen_dict {
use roc_std::RocStr; use roc_std::RocStr;
#[test] #[test]
@ -519,4 +509,3 @@ mod gen_dict {
i64 i64
); );
} }
}

View file

@ -1,18 +1,8 @@
#[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]
mod helpers;
#[cfg(test)]
mod gen_hash {
#[test] #[test]
fn basic_hash() { fn basic_hash() {
@ -154,4 +144,3 @@ mod gen_hash {
u64 u64
); );
} }
}

View file

@ -1,19 +1,9 @@
#[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;
extern crate roc_gen;
#[macro_use]
mod helpers;
#[cfg(test)]
mod gen_list {
use crate::helpers::with_larger_debug_stack; use crate::helpers::with_larger_debug_stack;
use indoc::indoc;
use roc_std::{RocList, RocStr}; use roc_std::{RocList, RocStr};
#[test] #[test]
@ -628,8 +618,8 @@ mod gen_list {
"# "#
), ),
RocList::from_slice(&[ RocList::from_slice(&[
1.2, 1.1, 2.1, 2.2, 3.0, 4.0, 5.0, 6.1, 9.0, 3.0, 4.0, 5.0, 6.1, 9.0, 3.0, 4.0, 1.2, 1.1, 2.1, 2.2, 3.0, 4.0, 5.0, 6.1, 9.0, 3.0, 4.0, 5.0, 6.1, 9.0, 3.0, 4.0, 5.0,
5.0, 6.1, 9.0, 3.0, 4.0, 5.0, 6.1, 9.0, 3.0, 4.0, 5.0, 6.1, 9.0 6.1, 9.0, 3.0, 4.0, 5.0, 6.1, 9.0, 3.0, 4.0, 5.0, 6.1, 9.0
]), ]),
RocList<f64> RocList<f64>
); );
@ -1752,4 +1742,3 @@ mod gen_list {
RocList<bool> RocList<bool>
); );
} }
}

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,18 +1,9 @@
#[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]
mod helpers;
#[cfg(test)]
mod gen_records {
#[test] #[test]
fn basic_record() { fn basic_record() {
assert_evals_to!( assert_evals_to!(
@ -893,4 +884,3 @@ mod gen_records {
i64 i64
); );
} }
}

View file

@ -1,18 +1,8 @@
#[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]
mod helpers;
#[cfg(test)]
mod gen_result {
#[test] #[test]
fn with_default() { fn with_default() {
@ -108,4 +98,3 @@ mod gen_result {
i64 i64
); );
} }
}

View file

@ -1,18 +1,8 @@
#[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]
mod helpers;
#[cfg(test)]
mod gen_set {
#[test] #[test]
fn empty_len() { fn empty_len() {
@ -245,4 +235,3 @@ mod gen_set {
&[i64] &[i64]
); );
} }
}

View file

@ -1,26 +1,13 @@
#[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]
mod helpers;
const ROC_STR_MEM_SIZE: usize = core::mem::size_of::<RocStr>();
#[cfg(test)]
mod gen_str {
use crate::ROC_STR_MEM_SIZE;
use roc_std::RocStr; use roc_std::RocStr;
use std::cmp::min; use std::cmp::min;
const ROC_STR_MEM_SIZE: usize = core::mem::size_of::<RocStr>();
fn small_str(str: &str) -> [u8; ROC_STR_MEM_SIZE] { 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();
@ -823,10 +810,9 @@ mod gen_str {
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,11 +1,5 @@
extern crate bumpalo; #![cfg(test)]
extern crate inkwell;
extern crate libc;
extern crate roc_gen;
#[cfg(test)]
mod gen_tags {
#[macro_use]
use crate::assert_evals_to; use crate::assert_evals_to;
use crate::assert_llvm_evals_to; use crate::assert_llvm_evals_to;
use indoc::indoc; use indoc::indoc;
@ -980,4 +974,3 @@ mod gen_tags {
|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;