-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Includes a new method for putting the hex representation of binary data into a ztest yaml file that also allows comments so the binary data can be annotated/explained by the test author. Also fix a few spec issues. The test is far from comprehensive but it would at least have caught the bug fixed in PR #377. Co-Authored-By: Alfred Landrum <alfred@leakybucket.org>
- Loading branch information
1 parent
ffa883e
commit 3ac86e9
Showing
3 changed files
with
110 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
zql: '*' | ||
|
||
input: | | ||
#0:record[_path:string,ts:time,d:float64] | ||
0:[a;10;1;] | ||
0:[xyz;20;1.5;] | ||
output-format: bzng | ||
|
||
outputHex: | | ||
# define a record with 3 columns | ||
80 03 | ||
# first column name is _path (len 5) | ||
05 5f 70 61 74 68 | ||
# first column type is string (9) | ||
09 | ||
# second column name is ts (len 2) | ||
02 74 73 | ||
# second column type is time (16 == 0x10) | ||
10 | ||
# third column name is d (len 1) | ||
01 64 | ||
# third column type is float64 (8) | ||
08 | ||
# value using type id 23 (0x17), the record defined above | ||
# total length of this recor is 17 bytes (0x11) | ||
17 11 | ||
# first column is a primitive value, 2 total bytes | ||
04 | ||
# value of the first column is the string "a" | ||
61 | ||
# second column is a primitive value, 6 total bytes | ||
0c | ||
# time value is encoded in nanoseconds shifted one bit left | ||
# 2000000000 == 0x04a817c800 | ||
00 c8 17 a8 04 | ||
# third column is a primitive value, 9 total bytes | ||
12 | ||
# 8 bytes of float64 data representing 1.0 | ||
00 00 00 00 00 00 f0 3f | ||
# another encoded value using the same record definition as before | ||
17 13 | ||
# first column: primitive value of 4 total byte, values xyz | ||
08 78 79 7a | ||
# second column: primitive value of 20 (converted to nanoseconds, encoded <<1) | ||
0c 00 90 2f 50 09 | ||
# third column, primitive value of 9 total bytes, float64 1.5 | ||
12 00 00 00 00 00 00 f8 3f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters