import * as ziba from "./ziba.js"
export function test() {
testTransform()
}
function testTransform() {
const tests = [
{
html:"",
expected:"",
},
{
html:'',
expected:'',
},
{
html:'apple',
expected:'apple',
},
{
html:'banana',
expected:'banana',
},
{
html:'cherry',
expected:'cherry',
},
{
html:'ONCE TWICE THRICE FOURCE',
expected:'ONCE TWICE THRICE FOURCE',
},
{
html:'once',
expected:'once',
},
{
html:'twice',
expected:'twice',
},
{
html:'thrice',
expected:'thrice',
},
{
html:'fource',
expected:'fource',
},
{
html:'ONCE TWICE THRICE FOURCE',
expected:'ONCE TWICE THRICE FOURCE',
},
{
html:'
',
expected:'',
},
{
html:'e',
expected:'e',
},
{
html:'E',
expected:'E',
},
{
html:'example',
expected:'example',
},
{
html:'Example',
expected:'Example',
},
{
html:'eXAMPLE',
expected:'eXAMPLE',
},
{
html:'EXAMPLE',
expected:'EXAMPLE',
},
{
html:'Hello world',
expected:'Hello world',
},
{
html:'apple Banana CHERRY',
expected:'apple Banana CHERRY',
},
{
html:'apple Banana CHERRY',
expected:'apple Banana CHERRY',
},
{
html:'e',
expected:'e',
},
{
html:'E',
expected:'E',
},
{
html:'example',
expected:'example',
},
{
html:'Example',
expected:'Example',
},
{
html:'eXAMPLE',
expected:'eXAMPLE',
},
{
html:'EXAMPLE',
expected:'EXAMPLE',
},
{
html:'Hello world',
expected:'Hello world',
},
{
html:'apple Banana CHERRY',
expected:'apple Banana CHERRY',
},
{
html:'apple Banana CHERRY',
expected:'apple Banana CHERRY',
},
{
html:'e',
expected:'e',
},
{
html:'E',
expected:'E',
},
{
html:'example',
expected:'example',
},
{
html:'Example',
expected:'Example',
},
{
html:'eXAMPLE',
expected:'eXAMPLE',
},
{
html:'EXAMPLE',
expected:'EXAMPLE',
},
{
html:'Hello world',
expected:'Hello world',
},
{
html:'apple Banana CHERRY',
expected:'apple Banana CHERRY',
},
{
html:'apple Banana CHERRY',
expected:'apple Banana CHERRY',
},
{
html:'e',
expected:'e',
},
{
html:'E',
expected:'E',
},
{
html:'example',
expected:'example',
},
{
html:'Example',
expected:'Example',
},
{
html:'eXAMPLE',
expected:'eXAMPLE',
},
{
html:'EXAMPLE',
expected:'EXAMPLE',
},
{
html:'Hello world',
expected:'Hello world',
},
{
html:'apple Banana CHERRY',
expected:'apple Banana CHERRY',
},
{
html:'apple Banana CHERRY',
expected:'apple Banana CHERRY',
},
{
html:'e',
expected:'e',
},
{
html:'E',
expected:'E',
},
{
html:'example',
expected:'example',
},
{
html:'Example',
expected:'Example',
},
{
html:'eXAMPLE',
expected:'eXAMPLE',
},
{
html:'EXAMPLE',
expected:'EXAMPLE',
},
{
html:'Hello world',
expected:'Hello world',
},
{
html:'apple Banana CHERRY',
expected:'apple Banana CHERRY',
},
{
html:'apple Banana CHERRY',
expected:'apple Banana CHERRY',
},
{
html:'e',
expected:'e',
},
{
html:'E',
expected:'E',
},
{
html:'example',
expected:'example',
},
{
html:'Example',
expected:'Example',
},
{
html:'eXAMPLE',
expected:'eXAMPLE',
},
{
html:'EXAMPLE',
expected:'EXAMPLE',
},
{
html:'Hello world',
expected:'Hello world',
},
{
html:'apple Banana CHERRY',
expected:'apple Banana CHERRY',
},
{
html:'apple Banana CHERRY',
expected:'apple Banana CHERRY',
},
{
html:'e',
expected:'e',
},
{
html:'E',
expected:'E',
},
{
html:'example',
expected:'example',
},
{
html:'Example',
expected:'Example',
},
{
html:'eXAMPLE',
expected:'eXAMPLE',
},
{
html:'EXAMPLE',
expected:'EXAMPLE',
},
{
html:'Hello world',
expected:'Hello world',
},
{
html:'apple Banana CHERRY',
expected:'apple Banana CHERRY',
},
{
html:'apple Banana CHERRY',
expected:'apple Banana CHERRY',
},
{
html:'e',
expected:'e',
},
{
html:'E',
expected:'E',
},
{
html:'example',
expected:'example',
},
{
html:'Example',
expected:'Example',
},
{
html:'eXAMPLE',
expected:'eXAMPLE',
},
{
html:'EXAMPLE',
expected:'EXAMPLE',
},
{
html:'Hello world',
expected:'Hello world',
},
{
html:'apple Banana CHERRY',
expected:'apple Banana CHERRY',
},
{
html:'apple Banana CHERRY',
expected:'apple Banana CHERRY',
},
]
tests.forEach(function(test, testNumber){
if (undefined === ziba.transform) {
console.error("[test-transform] For test", testNumber, "ziba.transform is undefined.")
return
}
const html = test.html
const expected = test.expected
const element = document.createElement("div")
element.innerHTML = html
ziba.transform(element)
const actual = element.innerHTML
if (expected !== actual) {
console.error("[test-transform] For test №", testNumber, "the actual value is not what was expected.")
console.log("[test-transform] EXPECTED:", JSON.stringify(expected))
console.log("[test-transform] ACTUAL: ", JSON.stringify(actual))
console.log("[test-transform] HTML: ", JSON.stringify(html))
return
}
console.log("[test-transform] Test №", testNumber, "passed.")
})
}