mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 12:18:19 +00:00
Check in gen tests that don't work yet
This commit is contained in:
parent
f95c5aee12
commit
d01c5c83b7
4 changed files with 51 additions and 3 deletions
|
@ -41,9 +41,9 @@ impl FlatDecodable {
|
|||
_ => Err(Underivable),
|
||||
},
|
||||
FlatType::Record(fields, ext) => {
|
||||
check_empty_ext_var(subs, ext, |ext| {
|
||||
matches!(ext, Content::Structure(FlatType::EmptyRecord))
|
||||
})?;
|
||||
//check_empty_ext_var(subs, ext, |ext| {
|
||||
// matches!(ext, Content::Structure(FlatType::EmptyRecord))
|
||||
//})?;
|
||||
|
||||
if subs
|
||||
.get_subs_slice(fields.record_fields())
|
||||
|
|
|
@ -6158,8 +6158,14 @@ fn from_can_when<'a>(
|
|||
// We can't know what to return!
|
||||
return Stmt::RuntimeError("Hit a 0-branch when expression");
|
||||
}
|
||||
dbg!(&branches);
|
||||
let opt_branches = to_opt_branches(env, procs, branches, exhaustive_mark, layout_cache);
|
||||
|
||||
dbg!(roc_types::subs::SubsFmtContent(
|
||||
env.subs.get_content_without_compacting(cond_var),
|
||||
env.subs
|
||||
));
|
||||
|
||||
let cond_layout = return_on_layout_error!(
|
||||
env,
|
||||
layout_cache.from_var(env.arena, cond_var, env.subs),
|
||||
|
|
|
@ -952,3 +952,26 @@ fn encode_then_decode_list_of_lists_of_strings() {
|
|||
RocStr
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(all(
|
||||
any(feature = "gen-llvm"), // currently fails on gen-wasm
|
||||
not(feature = "gen-llvm-wasm") // hits a stack limit in wasm3
|
||||
))]
|
||||
#[ignore]
|
||||
fn decode_record_two_fields() {
|
||||
assert_evals_to!(
|
||||
indoc!(
|
||||
r#"
|
||||
app "test" imports [Encode, Decode, Json] provides [main] to "./platform"
|
||||
|
||||
main =
|
||||
when Str.toUtf8 "{\"first\":\"ab\",\"second\":\"cd\"}" |> Decode.fromBytes Json.fromUtf8 is
|
||||
Ok { first, second } -> Str.concat first second
|
||||
_ -> "something went wrong"
|
||||
"#
|
||||
),
|
||||
RocStr::from("ab "),
|
||||
RocStr
|
||||
)
|
||||
}
|
||||
|
|
|
@ -1922,3 +1922,22 @@ fn issue_3669() {
|
|||
"#
|
||||
)
|
||||
}
|
||||
|
||||
#[mono_test]
|
||||
#[ignore]
|
||||
fn decode_record_two_fields() {
|
||||
indoc!(
|
||||
r#"
|
||||
app "helloWorld"
|
||||
imports [Decode, Json]
|
||||
provides [main] to "./platform"
|
||||
|
||||
main =
|
||||
when Str.toUtf8 "{\"first\":\"ab\",\"second\":[\"cd\",\"ef\"]}" |> Decode.decodeWith Decode.decoder Json.fromUtf8 is
|
||||
{result, rest: _} ->
|
||||
when result is
|
||||
Ok { first, second } -> Str.concat first (Str.joinWith second ",")
|
||||
Err _ -> "<bad>"
|
||||
"#
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue