Skip to content

Instantly share code, notes, and snippets.

@oppara
Created December 17, 2009 15:12
Show Gist options
  • Save oppara/258799 to your computer and use it in GitHub Desktop.
Save oppara/258799 to your computer and use it in GitHub Desktop.
tap.js
// @see http://search.cpan.org/~mschwern/Test-Simple/lib/Test/More.pm
function test (num) {
if ( num > 0 ) {
console.log('1..' + num);
}
}
function is (got, expected, message) {
var str = '';
if (got !== expected) {
str += 'not ';
}
str += 'OK';
if (message) {
str += ' # ' + message;
}
console.log( str );
if (got !== expected) {
console.log('# got: ' + got);
console.log('# expected: ' + expected);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment