dynamicbible/biblerefparsingtests.html
jwall@VAPPRCSN015.vap.local 4b80d0ef22 na
2011-11-22 10:53:06 -05:00

88 lines
4.2 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="author" content="Jason Wall" />
<meta name="PBO.auth" content="8bff0c5d7a8f61d1e5dfa6c58da67c2b" />
<meta name="geo.country" content="US" />
<meta name="dc.language" content="en" />
<meta name="dc.title" content="walljm.com || AJAX Bible || King James Version with Strong's Dictionary and Cross References" />
<meta name="description" content="An AJAX implimentation of The King James Version Bible with Strong's Dictionary integrated." />
<meta name="keywords" content="AJAX, KJV, King James Version, Strong's Dictionary, Strongs" />
<meta name="blogchalk" content="United States, Missouri, Saint Louis, English, Jason, Male, 21-25, photography, poetry" />
<meta name="copyright" content="All content copyrighted to Jason Wall, and available by permission of the owner." />
<title>The Bible with Strong's Numbers and Cross References</title>
<script type="text/javascript" src="js/jquery.min.js"></script>
<!--<script type="text/javascript" src="js/bible_ref_parsing.js"></script>-->
<script type="text/javascript" src="js/bible_ref_parsing.min.js"></script>
<script type="text/javascript">
$(document).ready(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"],
["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"],
["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:*"]
];
var b = $("body");
var passed = 0;
var failed = 0;
for (var i = 0; i < tests.length; i++)
{
var t = tests[i];
var ref = new Reference(t[0]);
var r = "<b>Test " + i + ":</b> " + t[0] + "<br />";
var parsed = ref.bookname + " " + ref.startchapter + ":" + ref.startverse + " - " + ref.endchapter + ":" + ref.endverse;
r += "<b>Value:</b> " + parsed + "<br />";
if (parsed == t[1])
{
r += "<span style='color:green'>Passed</span><br /><br />";
passed++;
}
else
{
r += "<span style='color:red'>Failed</span><br /><br />";
failed++;
}
b.append(r);
}
b.prepend(passed + " Passed, " + failed + " Failed<br /><br />");
});
</script>
</head>
<body>
</body>
</html>