Initial commit
Test (in pplus-core) / in-core (push) Failing after 28m44s

This commit is contained in:
alexm committed 2026-11-12 22:23:48 -05:00
commit 568474d52f
1591 files changed
+528213

No files matched your search

+29
View File
@@ -0,0 +1,29 @@
# probe: raising through calls, catching, and finally
# status: the expected output is Programming+'s interpreter's prediction; corpus.py verify confirms or refutes it on godbolt
# expect-stdout: checked 42
# expect-stdout: age 42
# expect-stdout: checked -3
# expect-stdout: bad: negative age
# expect-stdout: checked x
# expect-stdout: bad: String is not convertible to integer with base 10: 'x'
def parse_age(s: String) raises -> Int:
var n = atol(s)
if n < 0:
raise Error("negative age")
return n
def describe(s: String) -> String:
try:
var n = parse_age(s)
return "age " + String(n)
except e:
return "bad: " + String(e)
finally:
print("checked", s)
def main():
print(describe("42"))
print(describe("-3"))
print(describe("x"))