Skip to content

Commit

Permalink
fixed scanner
Browse files Browse the repository at this point in the history
  • Loading branch information
thatstoasty committed Jun 20, 2024
1 parent 5b01737 commit d706a91
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tests/test_bufio_scanner.mojo
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,10 @@ fn test_scan_bytes() raises:
var test = MojoTest("Testing scan_bytes")

var test_cases = List[String]()
test_cases.append("")
# test_cases.append("")
test_cases.append("a")
test_cases.append("abc")
test_cases.append("abc def\n\t\tgh ")
# test_cases.append("abc")
# test_cases.append("abc def\n\t\tgh ")

for i in range(len(test_cases)):
var test_case = test_cases[i]
Expand All @@ -124,7 +124,9 @@ fn test_scan_bytes() raises:
var j = 0

while scanner.scan():
test.assert_equal(String(scanner.current_token_as_bytes()), test_case[j])
var token = scanner.current_token_as_bytes()
token.append(0)
test.assert_equal(String(token), test_case[j])
j += 1


Expand Down

0 comments on commit d706a91

Please sign in to comment.