Welcome! Log In Create A New Profile

Advanced

[njs] Zlib: improved tests with zlib-ng.

Dmitry Volyntsev
April 22, 2024 09:12PM
details: https://hg.nginx.org/njs/rev/0cb259f67ade
branches:
changeset: 2320:0cb259f67ade
user: Dmitry Volyntsev <xeioex@nginx.com>
date: Mon Apr 22 17:52:14 2024 -0700
description:
Zlib: improved tests with zlib-ng.

This fixes #704 issue on Github.

diffstat:

src/test/njs_unit_test.c | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)

diffs (25 lines):

diff -r d640adf691a7 -r 0cb259f67ade src/test/njs_unit_test.c
--- a/src/test/njs_unit_test.c Mon Apr 22 17:52:06 2024 -0700
+++ b/src/test/njs_unit_test.c Mon Apr 22 17:52:14 2024 -0700
@@ -22319,14 +22319,15 @@ static njs_unit_test_t njs_zlib_test[]
njs_str("WAKA,αβγ") },

{ njs_str("const zlib = require('zlib');"
- "['WAKA', 'αβγ']"
- ".map(v => zlib.deflateRawSync(v).toString('base64'))"),
- njs_str("C3f0dgQA,O7fx3KZzmwE=") },
+ "const enc = ['WAKA', 'αβγ'].map(v => zlib.deflateRawSync(v).toString('base64'));"
+ "enc.map(v => zlib.inflateRawSync(Buffer.from(v, 'base64')).toString())"),
+ njs_str("WAKA,αβγ") },

{ njs_str("const zlib = require('zlib');"
- "['WAKA', 'αβγ']"
- ".map(v => zlib.deflateRawSync(v, {dictionary: Buffer.from('WAKA')}).toString('base64'))"),
- njs_str("CwdiAA==,O7fx3KZzmwE=") },
+ "const enc = ['WAKA', 'αβγ']"
+ ".map(v => zlib.deflateRawSync(v, {dictionary: Buffer.from('WAKA')}).toString('base64'));"
+ "enc.map(v => zlib.inflateRawSync(Buffer.from(v, 'base64'), {dictionary: Buffer.from('WAKA')}))"),
+ njs_str("WAKA,αβγ") },

{ njs_str("const zlib = require('zlib');"
"['WAKA', 'αβγ']"
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
https://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[njs] Zlib: improved tests with zlib-ng.

Dmitry Volyntsev 292 April 22, 2024 09:12PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 137
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready