Merge pull request #3619 from rtfeldman/gen-dev/array

Gen dev/array
This commit is contained in:
Brendan Hansknecht 2022-07-24 18:21:20 +00:00 committed by GitHub
commit 3e82d30e89
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 167 additions and 10 deletions

View file

@ -1,8 +1,8 @@
#[cfg(feature = "gen-llvm")]
use crate::helpers::llvm::assert_evals_to;
// #[cfg(feature = "gen-dev")]
// use crate::helpers::dev::assert_evals_to;
#[cfg(feature = "gen-dev")]
use crate::helpers::dev::assert_evals_to;
#[cfg(feature = "gen-wasm")]
use crate::helpers::wasm::assert_evals_to;
@ -25,25 +25,25 @@ fn roc_list_construction() {
}
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm", feature = "gen-dev"))]
fn empty_list_literal() {
assert_evals_to!("[]", RocList::<i64>::from_slice(&[]), RocList<i64>);
}
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm", feature = "gen-dev"))]
fn list_literal_empty_record() {
assert_evals_to!("[{}]", RocList::from_slice(&[()]), RocList<()>);
}
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm", feature = "gen-dev"))]
fn int_singleton_list_literal() {
assert_evals_to!("[1, 2]", RocList::from_slice(&[1, 2]), RocList<i64>);
}
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm", feature = "gen-dev"))]
fn int_list_literal() {
assert_evals_to!("[12, 9]", RocList::from_slice(&[12, 9]), RocList<i64>);
assert_evals_to!(
@ -133,7 +133,7 @@ fn bool_list_literal() {
}
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm", feature = "gen-dev"))]
fn variously_sized_list_literals() {
assert_evals_to!("[]", RocList::<i64>::from_slice(&[]), RocList<i64>);
assert_evals_to!("[1]", RocList::from_slice(&[1]), RocList<i64>);