-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
99 additions
and
12 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
*.sublime-* | ||
nimcache/ | ||
*.html | ||
|
||
commandeer | ||
testCommandeer |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
## When testing commandeer run it as follows on the command line: | ||
## ./testarguments 2.0 1 1 2 1 a | ||
|
||
import unittest | ||
|
||
import commandeer | ||
|
||
commandLine: | ||
argument floatNumber, float | ||
arguments intNumbers, int | ||
argument character, char | ||
option testing, bool, "testing", "t" | ||
|
||
echo("floatNumber = ", floatNumber) | ||
echo("intNumbers = ", intNumbers) | ||
echo("character = ", character) | ||
|
||
if testing: | ||
|
||
check floatNumber == 2.0 | ||
check intNumbers[0] == 1 | ||
check intNumbers[1] == 1 | ||
check intNumbers[2] == 2 | ||
check intNumbers[3] == 1 | ||
check character == 'a' | ||
|
||
echo "Tests Pass" |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
## When testing commandeer run it as follows on the command line: | ||
## ./teststringarguments file1 file2 file3 --testing | ||
|
||
import unittest | ||
|
||
import commandeer | ||
|
||
commandLine: | ||
arguments filenames, string, false | ||
option testing, bool, "testing", "t" | ||
|
||
echo("filenames = ", filenames) | ||
|
||
if testing: | ||
|
||
check filenames[0] == "file1" | ||
check filenames[1] == "file2" | ||
check filenames[2] == "file3" | ||
|
||
echo "Tests Pass" |