mirror of
https://gitlab.com/walljm/dynamicbible.git
synced 2025-07-27 09:29:59 -04:00
54 lines
2.2 KiB
TypeScript
54 lines
2.2 KiB
TypeScript
![]() |
/// <reference path="qunit.d.ts" />
|
|||
|
/// <reference path="reference.ts" />
|
|||
|
|
|||
|
QUnit.module("reference");
|
|||
|
|
|||
|
test("Tests Bible Reference Parsing", function () {
|
|||
|
var tests = [
|
|||
|
["acts 1:4 - 60", "Acts 1:4 - 1:60"],
|
|||
|
["acts 1:4 - *", "Acts 1:4 - 1:*"],
|
|||
|
["acts 1:4 - 2:8", "Acts 1:4 - 2:8"],
|
|||
|
["acts 1:4 - 1:8", "Acts 1:4 - 1:8"],
|
|||
|
["acts 1:4 - 2", "Acts 1:4 - 1:4"],
|
|||
|
["acts 1:4 - 8", "Acts 1:4 - 1:8"],
|
|||
|
["acts 1:4-8", "Acts 1:4 - 1:8"],
|
|||
|
["john 1:4 - john 2", "John 1:4 - 2:*"],
|
|||
|
["john 1 : 4 - john 2", "John 1:4 - 2:*"],
|
|||
|
["I john 1:4 - I john 2", "1 John 1:4 - 2:*"],
|
|||
|
["1 john 1:4 - 1 john 2", "1 John 1:4 - 2:*"],
|
|||
|
["1 john 1 : 4 - 1 john 2", "1 John 1:4 - 2:*"],
|
|||
|
["1 john 3 - 1 john 5", "1 John 3:1 - 5:*"],
|
|||
|
["1 John 1", "1 John 1:1 - 1:*"],
|
|||
|
["John 1", "John 1:1 - 1:*"],
|
|||
|
["1 John 1:1", "1 John 1:1 - 1:1"],
|
|||
|
[" 1 John 1 : 1 ", "1 John 1:1 - 1:1"],
|
|||
|
["John 1:1", "John 1:1 - 1:1"],
|
|||
|
[" John 1 : 1 ", "John 1:1 - 1:1"],
|
|||
|
[" 1 John 1 : 1 - 2 ", "1 John 1:1 - 1:2"],
|
|||
|
["1 John 1:1-2", "1 John 1:1 - 1:2"],
|
|||
|
["John 1:1-2", "John 1:1 - 1:2"],
|
|||
|
["John 1 : 1 - 2", "John 1:1 - 1:2"], //23
|
|||
|
["1 John 1 : 1 - 1 John 2 : 3 ", "1 John 1:1 - 2:3"],
|
|||
|
["1 John 1:1-1 John 2:3", "1 John 1:1 - 2:3"],
|
|||
|
["John 1:1-John 2:3", "John 1:1 - 2:3"],
|
|||
|
["John 1 : 1 - John 2 : 3 ", "John 1:1 - 2:3"], //27
|
|||
|
["John 1-2", "John 1:1 - 2:*"],
|
|||
|
["John 1 - 2", "John 1:1 - 2:*"],
|
|||
|
["1 John 1-2", "1 John 1:1 - 2:*"],
|
|||
|
["1 John 1 - 2 ", "1 John 1:1 - 2:*"],
|
|||
|
["John 3", "John 3:1 - 3:*"],
|
|||
|
["John 2:1-John 3:3", "John 2:1 - 3:3"],
|
|||
|
["John 2 : 1 - John 3 : 3 ", "John 2:1 - 3:3"],
|
|||
|
["John 3-4", "John 3:1 - 4:*"],
|
|||
|
["John 4 - 7", "John 4:1 - 7:*"],
|
|||
|
["1 John 4-6", "1 John 4:1 - 6:*"],
|
|||
|
["1 John 4 - 5 ", "1 John 4:1 - 5:*"]
|
|||
|
];
|
|||
|
for (var i = 0; i < tests.length; i++) {
|
|||
|
var t = tests[i];
|
|||
|
var ref = new Reference(t[0]);
|
|||
|
var parsed = ref.toString();
|
|||
|
equal(parsed, t[1], parsed + " == " + t[1]);
|
|||
|
}
|
|||
|
});
|