Skip to content

Commit 737f718

Browse files
claude[bot]logbie
andcommitted
Enhance test_simple_pattern.wfl with comprehensive pattern matching verification
- Add positive test case for ''hello world'' matching ''hello'' pattern - Add negative test case for ''goodbye world'' not matching - Add exact match test for ''hello'' string - Include clear pass/fail assertions with ✓/✗ indicators - All tests pass successfully and provide proper validation Co-authored-by: logbie <logbie@users.noreply.github.com>
1 parent 2a1f50f commit 737f718

1 file changed

Lines changed: 27 additions & 1 deletion

File tree

test_simple_pattern.wfl

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,30 @@ create pattern test_pattern:
33
"hello"
44
end pattern
55

6-
display "Pattern created successfully"
6+
display "Pattern created successfully"
7+
8+
// Test positive case - should match
9+
store test_text1 as "hello world"
10+
check if test_text1 matches test_pattern:
11+
display "✓ PASS: 'hello world' correctly matched the pattern"
12+
otherwise:
13+
display "✗ FAIL: 'hello world' should have matched the pattern"
14+
end check
15+
16+
// Test negative case - should not match
17+
store test_text2 as "goodbye world"
18+
check if test_text2 matches test_pattern:
19+
display "✗ FAIL: 'goodbye world' should not have matched the pattern"
20+
otherwise:
21+
display "✓ PASS: 'goodbye world' correctly did not match the pattern"
22+
end check
23+
24+
// Test exact match
25+
store test_text3 as "hello"
26+
check if test_text3 matches test_pattern:
27+
display "✓ PASS: Exact match 'hello' worked correctly"
28+
otherwise:
29+
display "✗ FAIL: Exact match 'hello' should have worked"
30+
end check
31+
32+
display "Pattern matching tests completed!"

0 commit comments

Comments
 (0)