From cb1fbac9223cc62739aa5c7bb97cba6e9dbd87c0 Mon Sep 17 00:00:00 2001 From: Li Jin Date: Tue, 13 Sep 2022 22:31:31 +0800 Subject: fix readme. --- spec/outputs/test/loops_spec.lua | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'spec/outputs') diff --git a/spec/outputs/test/loops_spec.lua b/spec/outputs/test/loops_spec.lua index 3fc0332..34f2e9c 100644 --- a/spec/outputs/test/loops_spec.lua +++ b/spec/outputs/test/loops_spec.lua @@ -1,5 +1,5 @@ return describe("loops", function() - return it("should continue", function() + it("should continue", function() local input = { 1, 2, @@ -36,4 +36,34 @@ return describe("loops", function() 6 }) end) + return it("continue in repeat", function() + local output = { } + local a = 0 + repeat + local _cond_0 = false + local _continue_0 = false + repeat + a = a + 1 + if a == 3 then + _cond_0 = a == 8 + _continue_0 = true + break + end + if a == 5 then + break + end + output[#output + 1] = a + _cond_0 = a == 8 + _continue_0 = true + until true + if not _continue_0 then + break + end + until _cond_0 + return assert.same(output, { + 1, + 2, + 4 + }) + end) end) -- cgit v1.2.3-55-g6feb