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

+33
View File
@@ -0,0 +1,33 @@
# probe: a struct wrapping a List with mut methods and an Optional result
# status: the expected output is Programming+'s interpreter's prediction; corpus.py verify confirms or refutes it on godbolt
# expect-stdout: size 3
# expect-stdout: 15 8 1
# expect-stdout: None
struct Stack(Movable):
var items: List[Int]
def __init__(out self):
self.items = List[Int]()
def push(mut self, x: Int):
self.items.append(x)
def pop(mut self) -> Optional[Int]:
if len(self.items) == 0:
return None
return self.items.pop()
def size(self) -> Int:
return len(self.items)
def main():
var s = Stack()
for x in [4, 8, 15]:
s.push(x)
print("size", s.size())
var a = s.pop()
var b = s.pop()
print(a, b, s.size())
_ = s.pop()
print(s.pop())