functionalscript
Version:
FunctionalScript is a purely functional subset of JavaScript
43 lines (42 loc) • 1.38 kB
JavaScript
import { htmlToString } from "./module.f.js";
export default {
empty: () => {
const r = htmlToString(['html']);
if (r !== '<html></html>') {
throw `empty: ${r}`;
}
},
empty2: () => {
const r = htmlToString(['html']);
if (r !== '<html></html>') {
throw r;
}
},
void: () => {
const r = htmlToString(['area']);
if (r !== '<area>') {
throw r;
}
},
some: () => {
const x = ['div', {}, '<div>&</div>', ['a', { href: 'hello"' }]];
const s = htmlToString(x);
if (s !== '<div><div>&amp;</div><a href="hello""></a></div>') {
throw s;
}
},
some2: () => {
const x = ['div', '<div>&</div>', ['a', { href: 'hello"' }]];
const s = htmlToString(x);
if (s !== '<div><div>&amp;</div><a href="hello""></a></div>') {
throw s;
}
},
someVoid: () => {
const x = ['div', ['br', { id: '5' }], '<div>&</div>', ['a', { href: 'hello"' }]];
const s = htmlToString(x);
if (s !== '<div><br id="5"><div>&amp;</div><a href="hello""></a></div>') {
throw s;
}
}
};