mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
BTest for sub_bytes
This commit is contained in:
parent
d551d4b9cf
commit
cbf1cd7398
3 changed files with 32 additions and 0 deletions
1
testing/btest/Baseline/bifs.sub_bytes/.stderr
Normal file
1
testing/btest/Baseline/bifs.sub_bytes/.stderr
Normal file
|
@ -0,0 +1 @@
|
|||
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
|
9
testing/btest/Baseline/bifs.sub_bytes/out
Normal file
9
testing/btest/Baseline/bifs.sub_bytes/out
Normal file
|
@ -0,0 +1,9 @@
|
|||
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
|
||||
bcde
|
||||
bcde
|
||||
bcde
|
||||
bcde
|
||||
bcde
|
||||
bcde
|
||||
bcde
|
||||
bcde
|
22
testing/btest/bifs/sub_bytes.zeek
Normal file
22
testing/btest/bifs/sub_bytes.zeek
Normal file
|
@ -0,0 +1,22 @@
|
|||
# @TEST-DOC: Test the sub_bytes() function.
|
||||
#
|
||||
# @TEST-EXEC: zeek -b %INPUT >out
|
||||
# @TEST-EXEC: btest-diff out
|
||||
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff .stderr
|
||||
|
||||
# These tests are to ensure that script optimization gets all the permutations
|
||||
# correct, for varying combinations of constant and variable arguments.
|
||||
|
||||
global s = "abcdefghij";
|
||||
global a = 2;
|
||||
global b = 4;
|
||||
|
||||
print sub_bytes(s, a, b);
|
||||
print sub_bytes(s, 2, b);
|
||||
print sub_bytes(s, a, 4);
|
||||
print sub_bytes(s, 2, 4);
|
||||
|
||||
print sub_bytes("abcdefghij", a, b);
|
||||
print sub_bytes("abcdefghij", 2, b);
|
||||
print sub_bytes("abcdefghij", a, 4);
|
||||
print sub_bytes("abcdefghij", 2, 4);
|
Loading…
Add table
Add a link
Reference in a new issue