Fix generated HTML for entity test

- Remove stray elements: </td>
- Add missing elements: <tr></tr>
- Add link to show where to get qjs from
This commit is contained in:
Rene Kita
2022-12-25 12:30:20 +01:00
parent 7c233b6590
commit 2692d22006
2 changed files with 2243 additions and 2242 deletions
+8 -7
View File
@@ -1,4 +1,5 @@
//Usage: qjs --std entity.js [test/tab] > outfile
// Usage: qjs --std entity.js [test/tab] > outfile
// See: https://github.com/bellard/quickjs
const a = getEntities();
@@ -15,9 +16,9 @@ function gentable(criteria, item) {
}
function gentestitem(b, c, d) {
let ha = "0x" + d[0].toString(16).toUpperCase() + "</td>";
let ha = "0x" + d[0].toString(16).toUpperCase();
if (d.length == 2)
var hb = "0x" + d[1].toString(16).toUpperCase() + "</td>";
var hb = "0x" + d[1].toString(16).toUpperCase();
else
var hb = "";
console.log(" <tr>");
@@ -54,19 +55,19 @@ function gentest() {
console.log(" <tr>");
console.log(" " +
"<th>Name</th><th>Hex 1</th><th>Hex 2</th><th>Hex result</th><th>Name result</th><th>Byte result</th>");
console.log(" </th>");
console.log(" </tr>");
gentable((b, d) => d.length == 1 && b[b.length - 1] == ';', gentestitem);
console.log("<th><hr></th><th><hr></th><th><hr></th><th><hr></th><th><hr></th><th><hr></th>");
console.log("<tr><th><hr></th><th><hr></th><th><hr></th><th><hr></th><th><hr></th><th><hr></th></tr>");
gentable((b, d) => d.length == 1 && b[b.length - 1] != ';', gentestitem);
console.log("<th><hr></th><th><hr></th><th><hr></th><th><hr></th><th><hr></th><th><hr></th>");
console.log("<tr><th><hr></th><th><hr></th><th><hr></th><th><hr></th><th><hr></th><th><hr></th></tr>");
gentable((b, d) => d.length == 2 && b[b.length - 1] == ';', gentestitem);
console.log("<th><hr></th><th><hr></th><th><hr></th><th><hr></th><th><hr></th><th><hr></th>");
console.log("<tr><th><hr></th><th><hr></th><th><hr></th><th><hr></th><th><hr></th><th><hr></th></tr>");
gentable((b, d) => d.length == 2 && b[b.length - 1] != ';', gentestitem);
+2235 -2235
View File
File diff suppressed because it is too large Load Diff