mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 13:59:08 +00:00
add a set of currently failing mono tests for inspect
This commit is contained in:
parent
5e36395369
commit
21b68a2e27
2 changed files with 178 additions and 0 deletions
|
@ -0,0 +1,48 @@
|
|||
procedure Inspect.147 (Inspect.317):
|
||||
ret Inspect.317;
|
||||
|
||||
procedure Inspect.249 (Inspect.250, Inspect.248):
|
||||
let Inspect.326 : Str = "\"";
|
||||
let Inspect.325 : Str = CallByName Inspect.61 Inspect.250 Inspect.326;
|
||||
let Inspect.321 : Str = CallByName Inspect.61 Inspect.325 Inspect.248;
|
||||
let Inspect.322 : Str = "\"";
|
||||
let Inspect.320 : Str = CallByName Inspect.61 Inspect.321 Inspect.322;
|
||||
ret Inspect.320;
|
||||
|
||||
procedure Inspect.30 ():
|
||||
let Inspect.316 : {} = Struct {};
|
||||
ret Inspect.316;
|
||||
|
||||
procedure Inspect.35 (Inspect.300):
|
||||
ret Inspect.300;
|
||||
|
||||
procedure Inspect.36 (Inspect.304):
|
||||
let Inspect.311 : Str = "";
|
||||
ret Inspect.311;
|
||||
|
||||
procedure Inspect.44 (Inspect.248):
|
||||
let Inspect.314 : {} = CallByName Inspect.30;
|
||||
let Inspect.313 : Str = CallByName Inspect.147 Inspect.248;
|
||||
ret Inspect.313;
|
||||
|
||||
procedure Inspect.5 (Inspect.150):
|
||||
let Inspect.312 : Str = CallByName Inspect.44 Inspect.150;
|
||||
let Inspect.309 : {} = Struct {};
|
||||
let Inspect.308 : Str = CallByName Inspect.36 Inspect.309;
|
||||
let Inspect.307 : Str = CallByName Inspect.249 Inspect.308 Inspect.312;
|
||||
ret Inspect.307;
|
||||
|
||||
procedure Inspect.61 (Inspect.303, Inspect.298):
|
||||
let Inspect.324 : Str = CallByName Str.3 Inspect.303 Inspect.298;
|
||||
dec Inspect.298;
|
||||
ret Inspect.324;
|
||||
|
||||
procedure Str.3 (#Attr.2, #Attr.3):
|
||||
let Str.292 : Str = lowlevel StrConcat #Attr.2 #Attr.3;
|
||||
ret Str.292;
|
||||
|
||||
procedure Test.0 ():
|
||||
let Test.3 : Str = "abc";
|
||||
let Test.2 : Str = CallByName Inspect.5 Test.3;
|
||||
let Test.1 : Str = CallByName Inspect.35 Test.2;
|
||||
ret Test.1;
|
|
@ -3289,3 +3289,133 @@ fn non_nullable_unwrapped_instead_of_nullable_wrapped() {
|
|||
"#
|
||||
)
|
||||
}
|
||||
|
||||
#[mono_test]
|
||||
fn inspect_custom_type() {
|
||||
indoc!(
|
||||
r#"
|
||||
app "test"
|
||||
imports []
|
||||
provides [main] to "./platform"
|
||||
|
||||
HelloWorld := {} implements [Inspect { toInspector: myToInspector }]
|
||||
|
||||
myToInspector : HelloWorld -> Inspector f where f implements InspectFormatter
|
||||
myToInspector = \@HellowWorld {} ->
|
||||
fmt <- Inspect.custom
|
||||
Inspect.apply (Inspect.str "Hello, World!\n") fmt
|
||||
|
||||
main =
|
||||
Inspect.inspect (@HelloWorld {})
|
||||
"#
|
||||
)
|
||||
}
|
||||
|
||||
#[mono_test]
|
||||
fn inspect_derived_string() {
|
||||
indoc!(
|
||||
r#"
|
||||
app "test"
|
||||
imports []
|
||||
provides [main] to "./platform"
|
||||
|
||||
main = Inspect.inspect "abc" |> Inspect.toDbgStr
|
||||
"#
|
||||
)
|
||||
}
|
||||
|
||||
#[mono_test]
|
||||
fn inspect_derived_record() {
|
||||
indoc!(
|
||||
r#"
|
||||
app "test"
|
||||
imports []
|
||||
provides [main] to "./platform"
|
||||
|
||||
main = Inspect.inspect {a: 7, b: 3dec} |> Inspect.toDbgStr
|
||||
"#
|
||||
)
|
||||
}
|
||||
#[mono_test]
|
||||
fn inspect_derived_record_one_field_string() {
|
||||
indoc!(
|
||||
r#"
|
||||
app "test"
|
||||
imports []
|
||||
provides [main] to "./platform"
|
||||
|
||||
main = Inspect.inspect {a: "foo"} |> Inspect.toDbgStr
|
||||
"#
|
||||
)
|
||||
}
|
||||
|
||||
#[mono_test]
|
||||
fn inspect_derived_record_two_field_strings() {
|
||||
indoc!(
|
||||
r#"
|
||||
app "test"
|
||||
imports []
|
||||
provides [main] to "./platform"
|
||||
|
||||
main = Inspect.inspect {a: "foo", b: "bar"} |> Inspect.toDbgStr
|
||||
"#
|
||||
)
|
||||
}
|
||||
|
||||
#[mono_test]
|
||||
fn inspect_derived_nested_record_string() {
|
||||
indoc!(
|
||||
r#"
|
||||
app "test"
|
||||
imports []
|
||||
provides [main] to "./platform"
|
||||
|
||||
main = Inspect.inspect {a: {b: "bar"}} |> Inspect.toDbgStr
|
||||
"#
|
||||
)
|
||||
}
|
||||
|
||||
#[mono_test]
|
||||
fn inspect_derived_tag_one_field_string() {
|
||||
indoc!(
|
||||
r#"
|
||||
app "test"
|
||||
imports []
|
||||
provides [main] to "./platform"
|
||||
|
||||
main =
|
||||
x : [A Str]
|
||||
x = A "foo"
|
||||
Inspect.inspect x |> Inspect.toDbgStr
|
||||
"#
|
||||
)
|
||||
}
|
||||
|
||||
#[mono_test]
|
||||
fn inspect_derived_tag_two_payloads_string() {
|
||||
indoc!(
|
||||
r#"
|
||||
app "test"
|
||||
imports []
|
||||
provides [main] to "./platform"
|
||||
|
||||
main =
|
||||
x : [A Str Str]
|
||||
x = A "foo" "foo"
|
||||
Inspect.inspect x |> Inspect.toDbgStr
|
||||
"#
|
||||
)
|
||||
}
|
||||
|
||||
#[mono_test]
|
||||
fn inspect_derived_list() {
|
||||
indoc!(
|
||||
r#"
|
||||
app "test"
|
||||
imports []
|
||||
provides [main] to "./platform"
|
||||
|
||||
main = Inspect.inspect [1, 2, 3] |> Inspect.toDbgStr
|
||||
"#
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue