aboutsummaryrefslogtreecommitdiff
path: root/spec/inputs/upvalue_func.yue
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2024-03-19 16:28:06 +0800
committerLi Jin <dragon-fly@qq.com>2024-03-19 16:28:06 +0800
commit80b65520da432843f0c63431a1867bd2620bc4ac (patch)
tree75b4a23bd6add2d358bdfba60630e9b444baa65b /spec/inputs/upvalue_func.yue
parent2733fe565c405f7b382fb7c02c69f78fb65d2f20 (diff)
downloadyuescript-0.23.0.tar.gz
yuescript-0.23.0.tar.bz2
yuescript-0.23.0.zip
more test cases.v0.23.0
Diffstat (limited to 'spec/inputs/upvalue_func.yue')
-rw-r--r--spec/inputs/upvalue_func.yue18
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/inputs/upvalue_func.yue b/spec/inputs/upvalue_func.yue
index a4155da..159be76 100644
--- a/spec/inputs/upvalue_func.yue
+++ b/spec/inputs/upvalue_func.yue
@@ -205,3 +205,21 @@ GameEngine\schedule (deltaTime) -> -- closure 1
205 UpdateScoreText "Score: #{value}" -- value is captured by closure 2 205 UpdateScoreText "Score: #{value}" -- value is captured by closure 2
206 "continue" 206 "continue"
207 207
208-- test cases from issue
209do
210 buff_strength = (char, item) ->
211 item.buffer.strength? char.stats.strength?::ref()
212
213 exe_func = (func, env) ->
214 ok, ... = try
215 debug_env_before(env)
216 func(env)
217 debug_env_after(env)
218 catch ex
219 -- accessing ex and error
220 error ex
221 return ex
222 if ok
223 return ...
224 else
225 os.exit(1)