Last active
August 29, 2015 14:06
-
-
Save danlamanna/7ba96510f6d280e8fc2d 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
| use "hw1.sml"; | |
| print("-------------------------\n"); | |
| print("-- Starting tests...\n"); | |
| print("primepower;\n"); | |
| primepower; | |
| print("primepower(0);\n"); | |
| primepower(0); | |
| print("primepower(1);\n"); | |
| primepower(1); | |
| print("primepower(823543);\n"); | |
| primepower(823543); | |
| print("primepower(214358881);\n"); | |
| primepower(214358881); | |
| print("primepower(~32);\n"); | |
| primepower(~32); | |
| print("\n\n"); | |
| print("consec_ones;\n"); | |
| consec_ones; | |
| print("consec_ones(5);\n"); | |
| consec_ones(5); | |
| print("consec_ones(6);\n"); | |
| consec_ones(6); | |
| print("consec_ones(7);\n"); | |
| consec_ones(7); | |
| print("consec_ones(49);\n"); | |
| consec_ones(49); | |
| print("consec_ones(~40);\n"); | |
| consec_ones(~40); | |
| print("consec_ones(~44);\n"); (* should be true, tests the abs value part *) | |
| consec_ones(~44); | |
| print("consec_ones(224);\n"); | |
| consec_ones(224); |
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
| function 519-test() { | |
| sml < $1.tests.sml | grep -v '^val\ it\ \=\ ()' | sed -n '/Starting tests/,$p' | |
| } | |
| # usage: 519-test hw1 | |
| # when hw1.sml and hw1.tests.sml are in the current working directory. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment