def test_put_return(self) -> None: pm = MyMock() action: Put = Put("hello, world!", Return(Unit)) action() self.assertEqual(pm.value, "hello, world!")
def test_put_return(self): pm = MyMock() p = Put.return_("hello, world!", IO(())) p(print=pm.print) self.assertEqual(pm.value, "hello, world!")
from oslash import Put, Get, IO main = Put( "What is your name?", Get(lambda name: Put( "What is your age?", Get(lambda age: Put("Hello " + name + "!", Put("You are " + age + " years old", IO(()))))))) if __name__ == "__main__": main()
def test_put_return(self): pm = MyMock() p = Put("hello, world!", IO(())) p(print=pm.print) self.assertEqual(pm.value, "hello, world!")