-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaml_tester.js
More file actions
24 lines (22 loc) · 827 Bytes
/
aml_tester.js
File metadata and controls
24 lines (22 loc) · 827 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
var translateModule = process.argv[2],
AMLTranslator = require(translateModule);
var testStrings = [
["Hello, World!",
"Hello, World!"],
["Hello, ^%World!^!%",
"Hello, <STRONG>World!</STRONG>"],
["Greetings ^%from ^~Glornix^!% Beta-Nine^!~.",
"Greetings <STRONG>from <EM>Glornix</EM></STRONG><EM> Beta-Nine</EM>."],
// Other test strings here
];
testStrings.forEach(function (testString, idx) {
translated = AMLTranslator.translate(testString[0]);
if (translated.toLowerCase() === testString[1].toLowerCase()) {
console.log("Example " + (idx + 1) + " is correct.");
} else {
console.log("Example " + (idx + 1) + " is incorrect!");
console.log(' Input: ' + testString[0]);
console.log(' Expected: ' + testString[1]);
console.log(' Received: ' + translated);
}
});