We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1d483fd commit d1f3d30Copy full SHA for d1f3d30
string/string_test.mbt
@@ -579,3 +579,25 @@ test "length_eq" {
579
assert_true!(str.length_eq(8))
580
assert_false!(str.length_eq(9))
581
}
582
+
583
+///|
584
+test {
585
+ enum Token {
586
+ True
587
+ False
588
+ Other
589
+ } derive(Show)
590
+ fn process_string(s : String) {
591
+ match s {
592
+ [.."true", ..] => True
593
+ [.."false", ..] => False
594
+ _ => Other
595
+ }
596
597
598
+ inspect!(process_string("truexx"), content="True")
599
+ // more tests
600
+ inspect!(process_string("false xx"), content="False")
601
+ inspect!(process_string("true"), content="True")
602
+ inspect!(process_string(""), content="Other")
603
+}
0 commit comments