diff options
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) | ||
