Example #1
0
 def test_memoization(self):
     f = Foobar()
     memoized = f.memoize(f.expensive())
     self.assertNodeOutput("$put(v0,$expensive())", memoized)
     self.assertNodeOutput("$put(v0,$expensive())", memoized)
     self.assertNodeOutput("$moo($put(v0,$expensive()),$get(v0))",
                           f.moo(memoized, memoized))
Example #2
0
 def test_memoization(self):
     f = Foobar()
     memoized = f.memoize(f.expensive())
     self.assertNodeOutput("$put(v0,$expensive())", memoized)
     self.assertNodeOutput("$put(v0,$expensive())", memoized)
     self.assertNodeOutput("$moo($put(v0,$expensive()),$get(v0))", f.moo(memoized, memoized))
Example #3
0
 def test_multi_arg(self):
     f = Foobar()
     self.assertNodeOutput("$moo('awesome',3,4)", f.moo('awesome', 3, 4))
Example #4
0
 def test_multi_arg(self):
     f = Foobar()
     self.assertNodeOutput("$moo('awesome',3,4)", f.moo('awesome', 3, 4))