zeek/testing/btest/bifs/print_raw.zeek
Jon Siwek 5622df4d1b Add new BIF: print_raw()
This is a convenience function to make it easier to print literal byte
sequences to stdout without additional escaping like what may be added
by the default `print` statement behavior.

For example, related to GH-596, `print` currently escapes even valid
UTF-8 byte sequences and makes it difficult to output valid JSON strings
containing such.
2019-10-02 15:21:24 -07:00

12 lines
257 B
Text

# @TEST-EXEC: zeek -b %INPUT >out
# @TEST-EXEC: btest-diff out
local j = to_json("\x07\xd4\xb7o");
local v: vector of count = vector();
v += 9;
v += 10;
print_raw(j, "\n");
print_raw("start ", j, 137, T, v, " finish", "\n");
print_raw("\xc3\xa9", "\n");