Skip to content

Commit c41e3e9

Browse files
committed
test: adds {gzip,zlib}_decode & inflate with optionalReadLimit
Signed-off-by: Dwi Siswanto <[email protected]>
1 parent f774f82 commit c41e3e9

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

dsl_test.go

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -435,17 +435,23 @@ func TestDslExpressions(t *testing.T) {
435435
`uniq("ab", "cd", "12", "34", "12", "cd")`: []string{"ab", "cd", "12", "34"},
436436
`join(" ", uniq("ab", "cd", "12", "34", "12", "cd"))`: "ab cd 12 34",
437437
`join(", ", split(hex_encode("abcdefg"), 2))`: "61, 62, 63, 64, 65, 66, 67",
438-
`json_minify("{ \"name\": \"John Doe\", \"foo\": \"bar\" }")`: "{\"foo\":\"bar\",\"name\":\"John Doe\"}",
439-
`json_prettify("{\"foo\":\"bar\",\"name\":\"John Doe\"}")`: "{\n \"foo\": \"bar\",\n \"name\": \"John Doe\"\n}",
440-
`ip_format('127.0.0.1', '1')`: "127.0.0.1",
441-
`ip_format('127.0.0.1', '3')`: "0177.0.0.01",
442-
`ip_format('127.0.0.1', '5')`: "2130706433",
443-
`ip_format('127.0.1.0', '11')`: "127.0.256",
444-
"unpack('>I', '\xac\xd7\t\xd0')": -272646673,
445-
"xor('\x01\x02', '\x02\x01')": []uint8([]byte{0x3, 0x3}),
446-
`count("projectdiscovery", "e")`: 2,
447-
`concat(to_title("pRoJeCt"), to_title("diScOvErY"))`: "ProjectDiscovery",
448-
`concat(to_title("welcome "), "to", to_title(" watch"), to_title("mojo"))`: "Welcome to WatchMojo",
438+
`json_minify("{ \"name\": \"John Doe\", \"foo\": \"bar\" }")`: "{\"foo\":\"bar\",\"name\":\"John Doe\"}",
439+
`json_prettify("{\"foo\":\"bar\",\"name\":\"John Doe\"}")`: "{\n \"foo\": \"bar\",\n \"name\": \"John Doe\"\n}",
440+
`ip_format('127.0.0.1', '1')`: "127.0.0.1",
441+
`ip_format('127.0.0.1', '3')`: "0177.0.0.01",
442+
`ip_format('127.0.0.1', '5')`: "2130706433",
443+
`ip_format('127.0.1.0', '11')`: "127.0.256",
444+
"unpack('>I', '\xac\xd7\t\xd0')": -272646673,
445+
"xor('\x01\x02', '\x02\x01')": []uint8([]byte{0x3, 0x3}),
446+
`count("projectdiscovery", "e")`: 2,
447+
`concat(to_title("pRoJeCt"), to_title("diScOvErY"))`: "ProjectDiscovery",
448+
`concat(to_title("welcome "), "to", to_title(" watch"), to_title("mojo"))`: "Welcome to WatchMojo",
449+
`zlib_decode(hex_decode("789cf248cdc9c907040000ffff058c01f5"), 4)`: "Hell",
450+
`gzip_decode(hex_decode("1f8b08000000000000fff248cdc9c907040000ffff8289d1f705000000"), 4)`: "Hell",
451+
`inflate(hex_decode("f248cdc9c907040000ffff"), 4)`: "Hell",
452+
`zlib_decode(hex_decode("789cf248cdc9c907040000ffff058c01f5"), 100)`: "Hello",
453+
`gzip_decode(hex_decode("1f8b08000000000000fff248cdc9c907040000ffff8289d1f705000000"), 100)`: "Hello",
454+
`inflate(hex_decode("f248cdc9c907040000ffff"), 100)`: "Hello",
449455
}
450456

451457
testDslExpressions(t, dslExpressions)

0 commit comments

Comments
 (0)