Skip to content

Commit a420ebb

Browse files
authored
feat: add extramojo v0.13.0 (#104)
1 parent f8653d3 commit a420ebb

File tree

3 files changed

+31
-27
lines changed

3 files changed

+31
-27
lines changed

recipes/ExtraMojo/recipe.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
context:
2-
version: "0.12.0"
2+
version: "0.13.0"
33

44
package:
55
name: "extramojo"
66
version: ${{ version }}
77

88
source:
99
- git: https://github.com/ExtraMojo/ExtraMojo.git
10-
rev: 25b6a6e7089138ab93f99d79401c57c8174c38ee
10+
rev: 97c9151d968206581cfd8a1d626c2e5d519046e5
1111

1212
build:
1313
number: 0

recipes/ExtraMojo/tests/test_bstr.mojo

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ from ExtraMojo.bstr.bstr import (
55
to_ascii_uppercase,
66
)
77
from ExtraMojo.bstr.memchr import memchr, memchr_wide
8-
from memory import Span
98
from testing import *
109

1110

@@ -28,30 +27,36 @@ fn s(bytes: Span[UInt8]) -> String:
2827

2928

3029
fn test_memchr() raises:
31-
var cases = List[(StringLiteral, Int)](
32-
(
33-
"enlivened,unleavened,Arnulfo's,Unilever's,unloved|Anouilh,analogue,analogy",
34-
49,
35-
),
36-
(
37-
"enlivened,unleavened,Arnulfo's,Unilever's,unloved,Anouilh,analogue,analogy,enlivened,unleavened,Arnulfo's,Unilever's,unloved|Anouilh,analogue,analogy",
38-
124,
39-
),
40-
)
41-
42-
for kase in cases:
43-
var index = memchr(kase[][0].as_bytes(), ord("|"))
44-
assert_equal(
45-
index,
46-
kase[][1],
47-
"Expected "
48-
+ String(kase[][1])
49-
+ " Found "
50-
+ String(index)
51-
+ " in "
52-
+ kase[][0],
30+
alias check = InlineArray[Bool, 2](True, False)
31+
32+
@parameter
33+
for do_alignment in range(0, len(check)):
34+
var cases = List[(StringLiteral, Int)](
35+
(
36+
"enlivened,unleavened,Arnulfo's,Unilever's,unloved|Anouilh,analogue,analogy",
37+
49,
38+
),
39+
(
40+
"enlivened,unleavened,Arnulfo's,Unilever's,unloved,Anouilh,analogue,analogy,enlivened,unleavened,Arnulfo's,Unilever's,unloved|Anouilh,analogue,analogy",
41+
124,
42+
),
5343
)
5444

45+
for kase in cases:
46+
var index = memchr[do_alignment = check[do_alignment]](
47+
kase[][0].as_bytes(), ord("|")
48+
)
49+
assert_equal(
50+
index,
51+
kase[][1],
52+
"Expected "
53+
+ String(kase[][1])
54+
+ " Found "
55+
+ String(index)
56+
+ " in "
57+
+ kase[][0],
58+
)
59+
5560

5661
fn test_memchr_wide() raises:
5762
var cases = List[(StringLiteral, Int)](

recipes/ExtraMojo/tests/test_file.mojo

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
from collections import Optional, Dict
1+
from collections import Dict
22
from utils import StringSlice
3-
from memory import Span
43
from pathlib import Path
54
from python import Python
65
from tensor import Tensor

0 commit comments

Comments
 (0)