mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-02 16:21:11 +00:00
fix alignment bug in list literals
This commit is contained in:
parent
44777c5cac
commit
3c8dbce72e
3 changed files with 24 additions and 7 deletions
|
@ -12,7 +12,7 @@ use crate::helpers::with_larger_debug_stack;
|
|||
#[allow(unused_imports)]
|
||||
use indoc::indoc;
|
||||
#[allow(unused_imports)]
|
||||
use roc_std::{RocList, RocResult, RocStr};
|
||||
use roc_std::{RocDec, RocList, RocResult, RocStr};
|
||||
|
||||
#[test]
|
||||
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm", feature = "gen-dev"))]
|
||||
|
@ -85,6 +85,16 @@ fn bool_list_literal() {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm", feature = "gen-dev"))]
|
||||
fn dec_list_literal() {
|
||||
assert_evals_to!(
|
||||
"[1.0, 2.0]",
|
||||
RocList::from_slice(&[RocDec::from(1), RocDec::from(2)]),
|
||||
RocList<RocDec>
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm", feature = "gen-dev"))]
|
||||
fn bool_list_concat() {
|
||||
|
@ -2799,6 +2809,12 @@ fn list_sum() {
|
|||
assert_evals_to!("List.sum [1.1f64, 2.2, 3.3]", 6.6, f64);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm", feature = "gen-dev"))]
|
||||
fn list_sum_dec() {
|
||||
assert_evals_to!("List.sum [1.0dec, 2.0]", RocDec::from(3), RocDec);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm", feature = "gen-dev"))]
|
||||
fn list_product() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue