97 lines
3.8 KiB
HTML
97 lines
3.8 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
|
<title>Test 034</title>
|
|
<script>
|
|
var Hyphenopoly = {
|
|
require: {
|
|
"foobar": "garzabariktimalborsi",
|
|
"en-us": "FORCEHYPHENOPOLY"
|
|
},
|
|
setup: {
|
|
safeCopy: false,
|
|
checkRes: true
|
|
},
|
|
handleEvent: {
|
|
hyphenopolyEnd: function (e) {
|
|
assert();
|
|
}
|
|
}
|
|
};
|
|
function assert() {
|
|
var tests = 2;
|
|
var i = 1;
|
|
var test = "";
|
|
var ref = "";
|
|
var result = true;
|
|
var lang = "";
|
|
while (i <= tests) {
|
|
lang = document.getElementById("test" + i).lang;
|
|
if (Hyphenopoly.cf.langs[lang] === "CSS") {
|
|
document.getElementById("result").innerHTML += "<p style=\"background-color: #d6ffd6\">" + i + " passed (CSS)</p>";
|
|
result = result && true;
|
|
} else {
|
|
test = document.getElementById("test" + i).innerHTML;
|
|
ref = document.getElementById("ref" + i).innerHTML;
|
|
if (test === ref) {
|
|
document.getElementById("result").innerHTML += "<p style=\"background-color: #d6ffd6\">" + i + " passed</p>";
|
|
result = result && true;
|
|
} else {
|
|
document.getElementById("result").innerHTML += "<p style=\"background-color: #ffd6d6\">" + i + " failed</p>";
|
|
result = false;
|
|
}
|
|
}
|
|
i += 1;
|
|
}
|
|
if (parent != window) {
|
|
parent.postMessage(JSON.stringify({
|
|
desc: document.getElementById("desc").innerHTML,
|
|
index: 34,
|
|
result: (result ? "passed" : "failed")
|
|
}), window.location.href);
|
|
}
|
|
}
|
|
</script>
|
|
<script src="../Hyphenopoly_Loader.js"></script>
|
|
<style type="text/css">
|
|
body {
|
|
width:50%;
|
|
margin-left:25%;
|
|
margin-right:25%;
|
|
}
|
|
|
|
.test {
|
|
background-color: #D8E2F9;
|
|
}
|
|
.ref {
|
|
background-color: #FEEFC0;
|
|
}
|
|
|
|
.hyphenate {
|
|
hyphens: auto;
|
|
-ms-hyphens: auto;
|
|
-moz-hyphens: auto;
|
|
-webkit-hyphens: auto;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div id="navigate"><a href="index.html">↞ Index</a> | <a href="test33.html">← Prev</a> | <a href="test35.html">Next →</a></div>
|
|
|
|
<h1>Test 034</h1>
|
|
<p id="desc">Recover from 404 if .hpb doesn't exist.</p>
|
|
<div id="result"></div>
|
|
<hr>
|
|
<h2>1: foobar</h2>
|
|
<p id="test1" class="test hyphenate" lang="foobar">Izgarz blonab schub ei follar quabsi zubur ma na fnaghi. Dalla burksi fad pelo i fnagha werksnar.</p>
|
|
<p id="ref1" class="ref" lang="foobar">Izgarz blonab schub ei follar quabsi zubur ma na fnaghi. Dalla burksi fad pelo i fnagha werksnar.</p>
|
|
<h2>2: en</h2>
|
|
<p id="test2" class="test hyphenate" lang="en-us">A hyphenation algorithm is a set of rules that decides at which points a word can be broken over two lines with a hyphen.</p>
|
|
<p id="ref2" class="ref" lang="en">A hy­phen­ation al­go­rithm is a set of rules that de­cides at which points a word can be bro­ken over two lines with a hy­phen.</p>
|
|
|
|
<hr>
|
|
<div><span class="test">Test</span> <span class="ref">Ref</span></div>
|
|
|
|
</body>
|
|
</html> |