From 30a11b0023ad1bc59662d1ead279ba92f6f57cdc Mon Sep 17 00:00:00 2001 From: Li Jin Date: Tue, 24 May 2022 10:06:53 +0800 Subject: add favicon and tests. --- spec/outputs/test/loops_spec.lua | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 spec/outputs/test/loops_spec.lua (limited to 'spec/outputs/test/loops_spec.lua') diff --git a/spec/outputs/test/loops_spec.lua b/spec/outputs/test/loops_spec.lua new file mode 100644 index 0000000..3fc0332 --- /dev/null +++ b/spec/outputs/test/loops_spec.lua @@ -0,0 +1,39 @@ +return describe("loops", function() + return it("should continue", function() + local input = { + 1, + 2, + 3, + 4, + 5, + 6 + } + local output + do + local _accum_0 = { } + local _len_0 = 1 + for _index_0 = 1, #input do + local x = input[_index_0] + local _continue_0 = false + repeat + if x % 2 == 1 then + _continue_0 = true + break + end + _accum_0[_len_0] = x + _len_0 = _len_0 + 1 + _continue_0 = true + until true + if not _continue_0 then + break + end + end + output = _accum_0 + end + return assert.same(output, { + 2, + 4, + 6 + }) + end) +end) -- cgit v1.2.3-55-g6feb