Add "output" and "stdout" build option unit tests.

Former-commit-id: 2adcdbff4cd1ef6319e33c69fd5ed3b07b205cfe
This commit is contained in:
John-David Dalton
2012-09-09 20:33:08 -07:00
parent 20fcede440
commit 5e04c7f827
3 changed files with 56 additions and 20 deletions

View File

@@ -38,14 +38,14 @@
source = source.replace(/("function")\s*==\s*(typeof define)\s*&&\s*\(?\s*("object")\s*==\s*(typeof define\.amd)\s*&&\s*(define\.amd)\s*\)?/, '$2==$1&&$4==$3&&$5');
// add trailing semicolon
source = source.replace(/[\s;]*$/, ';');
if (source) {
source = source.replace(/[\s;]*$/, ';');
}
// exit early if version snippet isn't found
var snippet = /VERSION\s*[=:]\s*([\'"])(.*?)\1/.exec(source);
if (!snippet) {
return source;
}
// add license
return licenseTemplate[/call\(this\);?$/.test(source) ? 'underscore' : 'lodash']
.replace('@VERSION', snippet[2]) + '\n;' + source;