From: Brendan Hansen Date: Mon, 15 Nov 2021 16:04:26 +0000 (-0600) Subject: changed lazy_iterators test X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=613d4fb47186eb9ebbe163b635ca72b4b4c7396d;p=onyx.git changed lazy_iterators test --- diff --git a/src/polymorph.c b/src/polymorph.c index dd3c6dff..cfa25705 100644 --- a/src/polymorph.c +++ b/src/polymorph.c @@ -125,7 +125,6 @@ static b32 add_solidified_function_entities(AstSolidifiedFunction *solidified_fu solidified_func->func_header_entity = entity_header; solidified_func->func->entity_header = entity_header; solidified_func->func->entity_body = entity_body; - return 1; } diff --git a/tests/lazy_iterators b/tests/lazy_iterators index 24126473..8a60478c 100644 --- a/tests/lazy_iterators +++ b/tests/lazy_iterators @@ -1,9 +1,9 @@ -Closing the count iterator... 54.0000 56.0000 58.0000 60.0000 62.0000 +Closing the count iterator... Starting the iteration... 54 56 @@ -11,7 +11,6 @@ Starting the iteration... 60 62 Closing the count iterator... -Closing the count iterator... 58 Starting the zipped iteration... diff --git a/tests/lazy_iterators.onyx b/tests/lazy_iterators.onyx index 7eb274a6..8000388f 100644 --- a/tests/lazy_iterators.onyx +++ b/tests/lazy_iterators.onyx @@ -38,19 +38,18 @@ main :: (args: [] cstr) { { quick_iterator := - count_iterator(1.0f, 10.0f) + count_iterator(1.0f, 20.0f) |> iter.map((x) => x * 2) |> iter.filter((x) => x > 10) |> iter.map((x) => x + 42) - |> iter.take(5) - |> iter.to_array(); + |> iter.take(5); for v: quick_iterator { println(v); } } - iterator := count_iterator(1, 10) + iterator := iter.as_iterator(1 .. 11) |> iter.map((x: i32) -> i32 { return x * 2; }) |> iter.filter((x: i32) -> bool { return x > 10; }) |> iter.map((x: i32) -> i32 { return x + 42; }); @@ -68,9 +67,9 @@ main :: (args: [] cstr) { println("\nStarting the zipped iteration..."); zipped_iterator := count_iterator(1, 10) - |> iter.map((x: i32) -> i32 { return x * 2; }) - |> iter.filter((x: i32) -> bool { return x > 10; }) - |> iter.map((x: i32) -> i32 { return x + 42; }) + |> iter.map((x) => x * 2) + |> iter.filter((x) => x > 10) + |> iter.map((x) => x + 42) |> iter.zip(iter.const(42.0f)); for value: zipped_iterator {