mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 21:39:07 +00:00
parent
a6b3656471
commit
1b9b6d89e4
1 changed files with 23 additions and 0 deletions
|
@ -932,6 +932,29 @@ fn encode_derived_generic_tag_with_different_field_types() {
|
|||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
|
||||
fn specialize_unique_newtype_records() {
|
||||
assert_evals_to!(
|
||||
indoc!(
|
||||
r#"
|
||||
app "test"
|
||||
imports [Encode, Json]
|
||||
provides [main] to "./platform"
|
||||
|
||||
main =
|
||||
when Str.fromUtf8 (Encode.toBytes {a: Bool.true} Json.toUtf8) is
|
||||
Ok s -> when Str.fromUtf8 (Encode.toBytes {b: Bool.true} Json.toUtf8) is
|
||||
Ok t -> "\(s)\(t)"
|
||||
_ -> "<bad>"
|
||||
_ -> "<bad>"
|
||||
"#
|
||||
),
|
||||
RocStr::from(r#"{"a":true}{"b":true}"#),
|
||||
RocStr
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
|
||||
fn decode_use_stdlib() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue