aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-08-18 20:39:57 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-08-18 20:39:57 -0400
commit967b649da20f1cb2011025456853cb55f25e9a88 (patch)
treeffce4f06f5fbb833c8aee2ba7c6982156f7bfac4 /test
parentd804b09b02b9c4a6ea6b16ae85524a704796cbc1 (diff)
Deprecate `#` operator in favor of .length and fix up some issues
Diffstat (limited to 'test')
-rw-r--r--test/arrays.tm6
-rw-r--r--test/iterators.tm2
-rw-r--r--test/nums.tm3
-rw-r--r--test/tables.tm4
-rw-r--r--test/text.tm4
5 files changed, 6 insertions, 13 deletions
diff --git a/test/arrays.tm b/test/arrays.tm
index 76507c5b..ac243018 100644
--- a/test/arrays.tm
+++ b/test/arrays.tm
@@ -12,7 +12,7 @@ func main():
>> arr[-1]
= 30
- >> #arr
+ >> arr.length
= 3
sum := 0
@@ -105,7 +105,7 @@ func main():
>> heap:heapify()
>> heap
sorted := [:Int]
- while #heap > 0:
+ while heap.length > 0:
sorted:insert(heap:heap_pop())
>> sorted == sorted:sorted()
= yes
@@ -113,7 +113,7 @@ func main():
heap:heap_push(Int.random(1, 50))
>> heap
sorted = [:Int]
- while #heap > 0:
+ while heap.length > 0:
sorted:insert(heap:heap_pop())
>> sorted == sorted:sorted()
= yes
diff --git a/test/iterators.tm b/test/iterators.tm
index 1f7ce342..0a2d2818 100644
--- a/test/iterators.tm
+++ b/test/iterators.tm
@@ -3,7 +3,7 @@ enum PairIteration(Done, Next(x:Text, y:Text))
func pairwise(strs:[Text])->func()->PairIteration:
i := 1
return func():
- if i + 1 > #strs: return PairIteration.Done
+ if i + 1 > strs.length: return PairIteration.Done
i += 1
return PairIteration.Next(strs[i-1], strs[i])
diff --git a/test/nums.tm b/test/nums.tm
index 94959744..48693f0e 100644
--- a/test/nums.tm
+++ b/test/nums.tm
@@ -37,9 +37,6 @@ func main():
>> Num.PI:sin():near(0)
= yes
- >> 10.0:pow(3)
- = 1000
-
>> Num.nan():near(Num.nan())
= no
diff --git a/test/tables.tm b/test/tables.tm
index 7f8383d8..7b3595b6 100644
--- a/test/tables.tm
+++ b/test/tables.tm
@@ -15,7 +15,7 @@ func main():
>> t_str
= "(one:1)(two:2)"
- >> #t
+ >> t.length
= 2
>> t.fallback
= !{Text:Int}
@@ -35,7 +35,7 @@ func main():
>> t2:get("???", 999)
= 999
- >> #t2
+ >> t2.length
= 1
>> t2.fallback
= @%{"one":1, "two":2}?
diff --git a/test/text.tm b/test/text.tm
index 2666b6c8..ce8ed43f 100644
--- a/test/text.tm
+++ b/test/text.tm
@@ -26,8 +26,6 @@ func main():
= [65_i32, 109_i32, 101_i32, 769_i32, 108_i32, 105_i32, 101_i32] : [Int32]
>> amelie:bytes()
= [65_i8, 109_i8, 101_i8, -52_i8, -127_i8, 108_i8, 105_i8, 101_i8] : [Int8]
- >> #amelie
- = 6
>> amelie:num_clusters()
= 6
>> amelie:num_codepoints()
@@ -42,8 +40,6 @@ func main():
= [65_i32, 109_i32, 101_i32, 769_i32, 108_i32, 105_i32, 101_i32] : [Int32]
>> amelie2:bytes()
= [65_i8, 109_i8, 101_i8, -52_i8, -127_i8, 108_i8, 105_i8, 101_i8] : [Int8]
- >> #amelie
- = 6
>> amelie2:num_clusters()
= 6
>> amelie2:num_codepoints()