Created
March 23, 2010 08:12
-
-
Save clairvy/340936 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| *.pyc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| You can test 'make test PROVE=prove'. | |
| then you can get bellow: | |
| $ make test | |
| prove ./test.pl | |
| ./test.pl .. ok | |
| All tests successful. | |
| Files=1, Tests=3, 0 wallclock secs ( 0.03 usr 0.01 sys + 0.05 cusr 0.04 csys = 0.13 CPU) | |
| Result: PASS |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| import hello | |
| if __name__ == '__main__' : | |
| print hello.greetings() | |
| print hello.greed.greetings() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| import hello | |
| def greetings(): | |
| return "greeding..Oops!" | |
| if __name__ == '__main__' : | |
| print hello.greetings() | |
| print greetings() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| import greed | |
| def greetings(): | |
| return "Hello" | |
| if __name__ == '__main__' : | |
| print greetings() | |
| print greed.greetings() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| PROVE = prove-5.10 | |
| do : | |
| ./aa.py | |
| test : testpl testpy | |
| testpl : | |
| $(PROVE) ./test.pl | |
| testpy : | |
| ./test.py | |
| clean : | |
| $(RM) $(RMF) *.pyc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env perl | |
| use strict; | |
| use warnings; | |
| use Test::More 'no_plan'; | |
| my $expected = <<'EOL'; | |
| Hello | |
| greeding..Oops! | |
| EOL | |
| is(`./aa.py`, $expected); | |
| is(`./hello.py`, $expected); | |
| is(`./greed.py`, $expected); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| import unittest | |
| import hello | |
| class MyTestCase(unittest.TestCase): | |
| def test_hello(self): | |
| self.assertEqual(hello.greetings(), "Hello") | |
| def test_greed(self): | |
| self.assertEqual(hello.greed.greetings(), "greeding..Oops!") | |
| if __name__ == '__main__': | |
| unittest.main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment