mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 23:31:12 +00:00
more type tooltip tests
This commit is contained in:
parent
3bec3b9d03
commit
bf69daa3bc
3 changed files with 9 additions and 4 deletions
|
@ -166,9 +166,9 @@ where
|
||||||
p.build()?
|
p.build()?
|
||||||
};
|
};
|
||||||
|
|
||||||
/*if DEBUG {
|
if DEBUG {
|
||||||
eprintln!("{}", program.to_source_string());
|
eprintln!("{}", program.to_source_string());
|
||||||
}*/
|
}
|
||||||
|
|
||||||
morphic_lib::solve(program)
|
morphic_lib::solve(program)
|
||||||
}
|
}
|
||||||
|
|
|
@ -355,7 +355,7 @@ fn write_content(env: &Env, content: Content, subs: &Subs, buf: &mut String, par
|
||||||
|
|
||||||
fn write_flat_type(env: &Env, flat_type: FlatType, subs: &Subs, buf: &mut String, parens: Parens) {
|
fn write_flat_type(env: &Env, flat_type: FlatType, subs: &Subs, buf: &mut String, parens: Parens) {
|
||||||
use crate::subs::FlatType::*;
|
use crate::subs::FlatType::*;
|
||||||
|
|
||||||
match flat_type {
|
match flat_type {
|
||||||
Apply(symbol, args) => write_apply(env, symbol, args, subs, buf, parens),
|
Apply(symbol, args) => write_apply(env, symbol, args, subs, buf, parens),
|
||||||
EmptyRecord => buf.push_str(EMPTY_RECORD),
|
EmptyRecord => buf.push_str(EMPTY_RECORD),
|
||||||
|
|
|
@ -1930,7 +1930,12 @@ pub mod test_ed_update {
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
assert_type_tooltip(&["┃"], "List *", '[')?;
|
assert_type_tooltip(&["┃"], "List *", '[')?;
|
||||||
|
assert_type_tooltips_seq(&["┃"], &vec!["List (Num *)"], "[0")?;
|
||||||
|
assert_type_tooltips_seq(&["┃"], &vec!["List (Num *)", "List (List (Num *))"], "[[0")?;
|
||||||
|
assert_type_tooltips_seq(&["┃"], &vec!["Str", "List Str"], "[\"a")?;
|
||||||
|
assert_type_tooltips_seq(&["┃"], &vec!["Str", "List Str", "List (List Str)", "List (List (List Str))"], "[[[\"a")?;
|
||||||
|
assert_type_tooltips_seq(&["┃"], &vec!["{ a : Num * }", "List { a : Num * }", "List (List { a : Num * })"], "[[{a:1")?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue