fix alignment bug in list literals

This commit is contained in:
Folkert 2023-09-13 14:02:55 +02:00
parent 44777c5cac
commit 3c8dbce72e
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
3 changed files with 24 additions and 7 deletions

View file

@ -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() {