mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-01 06:07:59 +00:00
45 lines
2.0 KiB
HTML
45 lines
2.0 KiB
HTML
<script src="../include.js"></script>
|
|
<script>
|
|
test(() => {
|
|
let testCounter = 1;
|
|
function testPart(part) {
|
|
try {
|
|
println(`${testCounter}. ${JSON.stringify(part())}`);
|
|
} catch (e) {
|
|
println(`${testCounter}. Exception: ${e.name}`);
|
|
}
|
|
testCounter++;
|
|
}
|
|
|
|
// 1. Creating a DOMMatrix
|
|
testPart(() => new DOMMatrix([10, 20, 30, 40, 50, 60]));
|
|
|
|
// 2. Creating a DOMMatrix
|
|
testPart(() => new DOMMatrix([10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160]));
|
|
|
|
// 3. Creating a DOMMatrix with fromMatrix
|
|
testPart(() => DOMMatrix.fromMatrix({ a: 10, b: 20, c: 30, d: 40, e: 50, f: 60 }));
|
|
|
|
// 4. Creating a DOMMatrix with fromMatrix
|
|
testPart(() => DOMMatrix.fromMatrix({ m11: 10, m12: 20, m13: 30, m14: 40, m21: 50, m22: 60, m23: 70, m24: 80, m31: 90, m32: 100, m33: 110, m34: 120, m41: 130, m42: 140, m43: 150, m44: 160 }));
|
|
|
|
// 5. Creating a DOMMatrix with fromFloat32Array
|
|
testPart(() => DOMMatrix.fromFloat32Array(new Float32Array([10, 20, 30, 40, 50, 60])));
|
|
|
|
// 6. Creating a DOMMatrix with fromFloat32Array
|
|
testPart(() => DOMMatrix.fromFloat32Array(new Float32Array([10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160])));
|
|
|
|
// 7. Creating a DOMMatrix with fromFloat64Array
|
|
testPart(() => DOMMatrix.fromFloat64Array(new Float64Array([10, 20, 30, 40, 50, 60])));
|
|
|
|
// 8. Creating a DOMMatrix with fromFloat64Array
|
|
testPart(() => DOMMatrix.fromFloat64Array(new Float64Array([10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160])));
|
|
|
|
// 9. Creating a DOMMatrix with fromFloat32Array wrong amount
|
|
testPart(() => DOMMatrix.fromFloat32Array(new Float32Array([10, 20, 30, 40])));
|
|
|
|
// 10. Creating a DOMMatrix with fromFloat64Array wrong amount
|
|
testPart(() => DOMMatrix.fromFloat64Array(new Float64Array([10, 20, 30, 40])));
|
|
});
|
|
</script>
|