Skip to content

Instantly share code, notes, and snippets.

@dfens
Created October 23, 2011 14:25
Show Gist options
  • Save dfens/1307414 to your computer and use it in GitHub Desktop.
Save dfens/1307414 to your computer and use it in GitHub Desktop.
Fill foo(x)
require 'test/unit'
def foo(x)
end
class TestFoo < Test::Unit::TestCase
def test_smoke_scenario
assert_equal 1, foo(foo(-1))
assert_equal -5, foo(foo(5))
assert_equal 0, foo(foo(0))
assert_equal 10, foo(foo(foo(foo(10))))
(1..100).each{|i| assert_equal -i, foo(foo(i))}
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment