mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 07:14:46 +00:00
tests(test_gen): add tests for mono
This commit is contained in:
parent
9da0193f2c
commit
fe9e9af576
3 changed files with 27 additions and 0 deletions
|
@ -2802,6 +2802,16 @@ pub fn with_hole<'a>(
|
|||
use crate::layout::UnionVariant::*;
|
||||
let arena = env.arena;
|
||||
|
||||
match layout_cache.from_var(arena, variant_var, env.subs) {
|
||||
Err(e) => panic!("invalid layout {:?}", e),
|
||||
Ok(Layout::FunctionPointer(argument_layouts, ret_layout)) => {
|
||||
dbg!(argument_layouts, ret_layout);
|
||||
}
|
||||
Ok(_) => {
|
||||
panic!("idk")
|
||||
}
|
||||
}
|
||||
|
||||
let res_variant = crate::layout::union_sorted_tags(env.arena, variant_var, env.subs);
|
||||
|
||||
let variant = match res_variant {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
use crate::ir::Parens;
|
||||
use bumpalo::collections::Vec;
|
||||
use bumpalo::Bump;
|
||||
use core::panic;
|
||||
use roc_collections::all::{default_hasher, MutMap, MutSet};
|
||||
use roc_module::ident::{Lowercase, TagName};
|
||||
use roc_module::symbol::{Interns, Symbol};
|
||||
|
|
|
@ -1803,3 +1803,19 @@ fn cleanup_because_exception() {
|
|||
RocList<bool>
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn applied_tag_function() {
|
||||
assert_evals_to!(
|
||||
indoc!(
|
||||
r#"
|
||||
x : List [ Foo Str ]
|
||||
x = List.map [ "a", "b" ] Foo
|
||||
|
||||
x
|
||||
"#
|
||||
),
|
||||
RocList::from_slice(&[false; 1]),
|
||||
RocList<bool>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue