update test_lzpf.js.. still no go
This commit is contained in:
@@ -1,20 +1,18 @@
|
|||||||
const WTVLzpf = require("./includes/classes/WTVLzpf.js")
|
const LZPF = require("./includes/classes/WTVLzpf.js")
|
||||||
const lzpf = new WTVLzpf();
|
const lzpf = new LZPF();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Test with a simple string
|
|
||||||
const testString = "This is a test string to compress and decompress";
|
const testString = "This is a test string to compress and decompress";
|
||||||
|
|
||||||
|
// Compress
|
||||||
const compressed = lzpf.Compress(testString);
|
const compressed = lzpf.Compress(testString);
|
||||||
|
console.log("Original data:", testString);
|
||||||
|
console.log("Compressed data (hex):", compressed.toString('hex'));
|
||||||
|
|
||||||
|
// Decompress with diagnostics
|
||||||
const decompressed = lzpf.Decompress(compressed);
|
const decompressed = lzpf.Decompress(compressed);
|
||||||
|
|
||||||
console.log("Original:", testString);
|
|
||||||
console.log("Decompressed:", decompressed.toString());
|
console.log("Decompressed:", decompressed.toString());
|
||||||
console.log("Match:", testString === decompressed.toString());
|
|
||||||
|
|
||||||
// Test with HTML-like data (which LZPF was optimized for)
|
// Compare
|
||||||
const htmlString = "<html><body><h1>Test</h1><p>This is a paragraph.</p></body></html>";
|
console.log("Original length:", testString.length);
|
||||||
const compressedHtml = lzpf.Compress(htmlString);
|
console.log("Decompressed length:", decompressed.length);
|
||||||
const decompressedHtml = lzpf.Decompress(compressedHtml);
|
console.log("Match:", testString === decompressed.toString());
|
||||||
|
|
||||||
console.log("HTML match:", htmlString === decompressedHtml.toString());
|
|
||||||
Reference in New Issue
Block a user