mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 13:29:12 +00:00
Fix wasm repl multiline string test
This commit is contained in:
parent
50ebffad5a
commit
eaa0824347
1 changed files with 20 additions and 4 deletions
|
@ -2,13 +2,12 @@
|
||||||
use indoc::indoc;
|
use indoc::indoc;
|
||||||
use roc_test_utils::assert_multiline_str_eq;
|
use roc_test_utils::assert_multiline_str_eq;
|
||||||
|
|
||||||
use crate::cli::repl_eval;
|
|
||||||
#[cfg(not(feature = "wasm"))]
|
#[cfg(not(feature = "wasm"))]
|
||||||
use crate::cli::{expect_failure, expect_success};
|
use crate::cli::{expect_failure, expect_success, repl_eval};
|
||||||
|
|
||||||
#[cfg(feature = "wasm")]
|
#[cfg(feature = "wasm")]
|
||||||
#[allow(unused_imports)]
|
#[allow(unused_imports)]
|
||||||
use crate::wasm::{expect_failure, expect_success};
|
use crate::wasm::{expect_failure, expect_success, repl_eval};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn literal_0() {
|
fn literal_0() {
|
||||||
|
@ -562,8 +561,9 @@ fn four_element_record() {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(not(wasm))]
|
||||||
#[test]
|
#[test]
|
||||||
fn multiline_string() {
|
fn multiline_string_non_wasm() {
|
||||||
// If a string contains newlines, format it as a multiline string in the output.
|
// If a string contains newlines, format it as a multiline string in the output.
|
||||||
|
|
||||||
// We can't use expect_success to test this, because it only looks at the last
|
// We can't use expect_success to test this, because it only looks at the last
|
||||||
|
@ -588,6 +588,22 @@ fn multiline_string() {
|
||||||
assert!(out.status.success());
|
assert!(out.status.success());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(wasm)]
|
||||||
|
#[test]
|
||||||
|
fn multiline_string_wasm() {
|
||||||
|
// If a string contains newlines, format it as a multiline string in the output
|
||||||
|
expect_success(
|
||||||
|
r#""\n\nhi!\n\n""#,
|
||||||
|
indoc!(
|
||||||
|
r#""""
|
||||||
|
|
||||||
|
hi!
|
||||||
|
|
||||||
|
""" : Str"#
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn list_of_3_field_records() {
|
fn list_of_3_field_records() {
|
||||||
expect_success(
|
expect_success(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue