fix test_gen gen_str tests

This commit is contained in:
Luke Boswell 2024-09-29 14:43:20 +10:00
parent aec3af667d
commit 81f007940c
No known key found for this signature in database
GPG key ID: F6DB3C9DB47377B0

View file

@ -1996,32 +1996,32 @@ fn str_drop_prefix() {
r#"
Str.dropPrefix "" "foo"
"#,
RocResult::ok(RocStr::from("")),
RocResult<RocStr, ()>
RocStr::from(""),
RocStr
);
assert_evals_to!(
r#"
Str.dropPrefix "bar" "foo"
"#,
RocResult::ok(RocStr::from("bar")),
RocResult<RocStr, ()>
RocStr::from("bar"),
RocStr
);
assert_evals_to!(
r#"
Str.dropPrefix "foobar" "foo"
"#,
RocResult::ok(RocStr::from("bar")),
RocResult<RocStr, ()>
RocStr::from("bar"),
RocStr
);
assert_evals_to!(
r#"
Str.dropPrefix "fooBarThisIsDefinitelyAReallyLongAndNotaShortString" "foo"
"#,
RocResult::ok(RocStr::from("BarThisIsDefinitelyAReallyLongAndNotaShortString")),
RocResult<RocStr, ()>
RocStr::from("BarThisIsDefinitelyAReallyLongAndNotaShortString"),
RocStr
);
}
@ -2032,31 +2032,31 @@ fn str_drop_suffix() {
r#"
Str.dropSuffix "" "foo"
"#,
RocResult::ok(RocStr::from("")),
RocResult<RocStr, ()>
RocStr::from(""),
RocStr
);
assert_evals_to!(
r#"
Str.dropSuffix "bar" "foo"
"#,
RocResult::ok(RocStr::from("bar")),
RocResult<RocStr, ()>
RocStr::from("bar"),
RocStr
);
assert_evals_to!(
r#"
Str.dropSuffix "barfoo" "foo"
"#,
RocResult::ok(RocStr::from("bar")),
RocResult<RocStr, ()>
RocStr::from("bar"),
RocStr
);
assert_evals_to!(
r#"
Str.dropSuffix "BarThisIsDefinitelyAReallyLongAndNotaShortStringfoo" "foo"
"#,
RocResult::ok(RocStr::from("BarThisIsDefinitelyAReallyLongAndNotaShortString")),
RocResult<RocStr, ()>
RocStr::from("BarThisIsDefinitelyAReallyLongAndNotaShortString"),
RocStr
);
}