From 2fcf1939bb295887592c1f24f7b8fbb10efcfcba Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Tue, 31 Dec 2024 16:23:16 -0500 Subject: [PATCH] Fix for heap_pop() test in arrays --- test/arrays.tm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/arrays.tm b/test/arrays.tm index e32ee59..965ef95 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