-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bump to 0.12.0: sam assert lib (very basic)
Use 'describe' to describe a particular suite, use 'expect' to compare strings or ints, will print an error message and exit(1) if it fails, do nothing otherwise. Prints 'Pass' after each describe block works successfully. Could be a lot more sophisticated, but better keep it simple, since it's used to test rock itself :)
- Loading branch information
1 parent
d88735e
commit d345383
Showing
5 changed files
with
37 additions
and
4 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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Name: sam-assert | ||
Description: Sam's simple assert library makes some tests shorter | ||
SourcePath: source | ||
Imports: sam/assert |
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,4 +1,4 @@ | ||
Name: sam | ||
Description: Sam keeps your ooc repos up to date | ||
Description: Sam keeps your ooc repos up to date and runs your tests | ||
SourcePath: source | ||
Main: sam.ooc |
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 |
---|---|---|
|
@@ -24,7 +24,7 @@ Sam: class { | |
|
||
args: Arguments | ||
home ::= args home | ||
VERSION := "0.11.0" | ||
VERSION := "0.12.0" | ||
|
||
init: func | ||
|
||
|
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,20 @@ | ||
|
||
expect: func ~str (given: String, expected: String) { | ||
if (given != expected) { | ||
"Fail! given #{given}, expected #{expected}" | ||
exit(1) | ||
} | ||
} | ||
|
||
expect: func ~int (given: Int, expected: Int) { | ||
if (given != expected) { | ||
"Fail! given #{given}, expected #{expected}" | ||
exit(1) | ||
} | ||
} | ||
|
||
describe: func (name: String, body: Func) { | ||
body() | ||
"Pass: #{name}" println() | ||
} | ||
|