diff options
| author | Li Jin <dragon-fly@qq.com> | 2024-03-19 16:28:06 +0800 |
|---|---|---|
| committer | Li Jin <dragon-fly@qq.com> | 2024-03-19 16:28:06 +0800 |
| commit | 80b65520da432843f0c63431a1867bd2620bc4ac (patch) | |
| tree | 75b4a23bd6add2d358bdfba60630e9b444baa65b /spec/inputs | |
| parent | 2733fe565c405f7b382fb7c02c69f78fb65d2f20 (diff) | |
| download | yuescript-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')
| -rw-r--r-- | spec/inputs/test/format_spec.yue | 1 | ||||
| -rw-r--r-- | spec/inputs/upvalue_func.yue | 18 |
2 files changed, 19 insertions, 0 deletions
diff --git a/spec/inputs/test/format_spec.yue b/spec/inputs/test/format_spec.yue index 5076445..cbd9d22 100644 --- a/spec/inputs/test/format_spec.yue +++ b/spec/inputs/test/format_spec.yue | |||
| @@ -50,6 +50,7 @@ files = [ | |||
| 50 | "spec/inputs/test/table_spreading_spec.yue" | 50 | "spec/inputs/test/table_spreading_spec.yue" |
| 51 | "spec/inputs/test/loops_spec.yue" | 51 | "spec/inputs/test/loops_spec.yue" |
| 52 | "spec/inputs/test/format_spec.yue" | 52 | "spec/inputs/test/format_spec.yue" |
| 53 | "spec/inputs/upvalue_func.yue" | ||
| 53 | "spec/inputs/unicode/macro_export.yue" | 54 | "spec/inputs/unicode/macro_export.yue" |
| 54 | "spec/inputs/unicode/attrib.yue" | 55 | "spec/inputs/unicode/attrib.yue" |
| 55 | "spec/inputs/unicode/macro.yue" | 56 | "spec/inputs/unicode/macro.yue" |
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 | ||
| 209 | do | ||
| 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) | ||
