aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-12-31 16:23:16 -0500
committerBruce Hill <bruce@bruce-hill.com>2024-12-31 16:23:16 -0500
commit2fcf1939bb295887592c1f24f7b8fbb10efcfcba (patch)
tree6e2759c52533b159f5cd7f67459941b10c863fb3
parent8df0cc41c95e6c01d9c4c0fd1f57fbe96f40bbe7 (diff)
Fix for heap_pop() test in arrays
-rw-r--r--test/arrays.tm8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/arrays.tm b/test/arrays.tm
index e32ee598..965ef95c 100644
--- a/test/arrays.tm
+++ b/test/arrays.tm
@@ -105,16 +105,16 @@ func main():
>> heap:heapify()
>> heap
sorted := @[:Int]
- while heap.length > 0:
- sorted:insert(heap:heap_pop())
+ repeat:
+ sorted:insert(heap:heap_pop() or stop)
>> sorted == sorted:sorted()
= yes
for _ in 10:
heap:heap_push(random:int(1, 50))
>> heap
sorted = @[:Int]
- while heap.length > 0:
- sorted:insert(heap:heap_pop())
+ repeat:
+ sorted:insert(heap:heap_pop() or stop)
>> sorted == sorted:sorted()
= yes