diff --git a/recipes/ExtraMojo/recipe.yaml b/recipes/ExtraMojo/recipe.yaml index 122876a4..dfed5a86 100644 --- a/recipes/ExtraMojo/recipe.yaml +++ b/recipes/ExtraMojo/recipe.yaml @@ -1,5 +1,5 @@ context: - version: "0.12.0" + version: "0.13.0" package: name: "extramojo" @@ -7,7 +7,7 @@ package: source: - git: https://github.com/ExtraMojo/ExtraMojo.git - rev: 25b6a6e7089138ab93f99d79401c57c8174c38ee + rev: 97c9151d968206581cfd8a1d626c2e5d519046e5 build: number: 0 diff --git a/recipes/ExtraMojo/tests/test_bstr.mojo b/recipes/ExtraMojo/tests/test_bstr.mojo index 62b472e4..db20a181 100644 --- a/recipes/ExtraMojo/tests/test_bstr.mojo +++ b/recipes/ExtraMojo/tests/test_bstr.mojo @@ -5,7 +5,6 @@ from ExtraMojo.bstr.bstr import ( to_ascii_uppercase, ) from ExtraMojo.bstr.memchr import memchr, memchr_wide -from memory import Span from testing import * @@ -28,30 +27,36 @@ fn s(bytes: Span[UInt8]) -> String: fn test_memchr() raises: - var cases = List[(StringLiteral, Int)]( - ( - "enlivened,unleavened,Arnulfo's,Unilever's,unloved|Anouilh,analogue,analogy", - 49, - ), - ( - "enlivened,unleavened,Arnulfo's,Unilever's,unloved,Anouilh,analogue,analogy,enlivened,unleavened,Arnulfo's,Unilever's,unloved|Anouilh,analogue,analogy", - 124, - ), - ) - - for kase in cases: - var index = memchr(kase[][0].as_bytes(), ord("|")) - assert_equal( - index, - kase[][1], - "Expected " - + String(kase[][1]) - + " Found " - + String(index) - + " in " - + kase[][0], + alias check = InlineArray[Bool, 2](True, False) + + @parameter + for do_alignment in range(0, len(check)): + var cases = List[(StringLiteral, Int)]( + ( + "enlivened,unleavened,Arnulfo's,Unilever's,unloved|Anouilh,analogue,analogy", + 49, + ), + ( + "enlivened,unleavened,Arnulfo's,Unilever's,unloved,Anouilh,analogue,analogy,enlivened,unleavened,Arnulfo's,Unilever's,unloved|Anouilh,analogue,analogy", + 124, + ), ) + for kase in cases: + var index = memchr[do_alignment = check[do_alignment]]( + kase[][0].as_bytes(), ord("|") + ) + assert_equal( + index, + kase[][1], + "Expected " + + String(kase[][1]) + + " Found " + + String(index) + + " in " + + kase[][0], + ) + fn test_memchr_wide() raises: var cases = List[(StringLiteral, Int)]( diff --git a/recipes/ExtraMojo/tests/test_file.mojo b/recipes/ExtraMojo/tests/test_file.mojo index 3cb14fe4..e76118a8 100644 --- a/recipes/ExtraMojo/tests/test_file.mojo +++ b/recipes/ExtraMojo/tests/test_file.mojo @@ -1,6 +1,5 @@ -from collections import Optional, Dict +from collections import Dict from utils import StringSlice -from memory import Span from pathlib import Path from python import Python from tensor import Tensor