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 = new WTVLzpf();
|
||||
const LZPF = require("./includes/classes/WTVLzpf.js")
|
||||
const lzpf = new LZPF();
|
||||
|
||||
|
||||
|
||||
// Test with a simple string
|
||||
const testString = "This is a test string to compress and decompress";
|
||||
|
||||
// Compress
|
||||
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);
|
||||
|
||||
console.log("Original:", testString);
|
||||
console.log("Decompressed:", decompressed.toString());
|
||||
|
||||
// Compare
|
||||
console.log("Original length:", testString.length);
|
||||
console.log("Decompressed length:", decompressed.length);
|
||||
console.log("Match:", testString === decompressed.toString());
|
||||
|
||||
// Test with HTML-like data (which LZPF was optimized for)
|
||||
const htmlString = "<html><body><h1>Test</h1><p>This is a paragraph.</p></body></html>";
|
||||
const compressedHtml = lzpf.Compress(htmlString);
|
||||
const decompressedHtml = lzpf.Decompress(compressedHtml);
|
||||
|
||||
console.log("HTML match:", htmlString === decompressedHtml.toString());
|
||||
|
||||
Reference in New Issue
Block a user