NAME=String Search - Errors - Empty string
FILE=bins/cmd/search/string_encodings/Latin-Lipsum.ascii
CMDS=<<EOF
/z ""
EOF
REGEXP_FILTER_ERR=ERROR.+
EXPECT_ERR=<<EOF
ERROR: core: invalid string: empty string.
EOF
RUN

NAME=String Search - Errors - Invalid regex args
FILE=bins/cmd/search/string_encodings/Latin-Lipsum.ascii
CMDS=<<EOF
/z "as" aa
/z "as" dd
EOF
REGEXP_FILTER_ERR=ERROR.+
EXPECT_ERR=<<EOF
ERROR: Flag combination 'aa' is invalid.
ERROR: Regex flags are invalid: 'aa'
ERROR: Flag combination 'dd' is invalid.
ERROR: Regex flags are invalid: 'dd'
EOF
RUN

NAME=String Search - Errors - Invalid encoding
FILE=bins/cmd/search/string_encodings/Latin-Lipsum.ascii
CMDS=<<EOF
/z as l aa
EOF
REGEXP_FILTER_ERR=ERROR.+
EXPECT_ERR=<<EOF
ERROR: rz_str: encoding 'aa' not supported
ERROR: core: invalid encoding 'aa'.
EOF
RUN

NAME=String Search - larger than file - Encoding: ascii - Latin
FILE=bins/cmd/search/string_encodings/Latin-Lipsum.ascii
CMDS=<<EOF
/z "Lorem ipsum dolor sit amet, at eligendi adipisci ius, ex natum appetere officiis has, nibh quas torquatos pro te. Quo at deleniti repudiandae, et oratio pertinacia ullamcorper quo. Per ut stet assum augue, brute pertinacia pri id. Sed omnium oblique placerat ut, eu etiam vitae nam. Per invenire expetenda dissentiet id, ea alia nostrud detraxit est, est eros intellegebat et.aaaaaaaaaaaaaaaa" l ascii
EOF
EXPECT=<<EOF
EOF
EXPECT_ERR=
RUN

NAME=String Search - minimal string - Encoding: ascii - Latin
FILE=bins/cmd/search/string_encodings/Latin-Lipsum.ascii
CMDS=<<EOF
e search.str.min_length=2
/z "et" l ascii
# Requires increasing the block size because -.-
b 0x1000
# Check string is actually at offset of the hit.
ps ascii unprintable @ hit.string.ascii.0
ps ascii unprintable @ hit.string.ascii.1
ps ascii unprintable @ hit.string.ascii.2
ps ascii unprintable @ hit.string.ascii.3
ps ascii unprintable @ hit.string.ascii.4
ps ascii unprintable @ hit.string.ascii.5
ps ascii unprintable @ hit.string.ascii.6
ps ascii unprintable @ hit.string.ascii.7
ps ascii unprintable @ hit.string.ascii.8
EOF
EXPECT=<<EOF
0x00000018 2 hit.string.ascii.0
0x00000042 2 hit.string.ascii.1
0x0000008f 2 hit.string.ascii.2
0x000000be 2 hit.string.ascii.3
0x0000010a 2 hit.string.ascii.4
0x0000012b 2 hit.string.ascii.5
0x0000013a 2 hit.string.ascii.6
0x00000152 2 hit.string.ascii.7
0x00000175 2 hit.string.ascii.8
et, at eligendi adipisci ius, ex natum appetere officiis has, nibh quas torquatos pro te. Quo at deleniti repudiandae, et oratio pertinacia ullamcorper quo. Per ut stet assum augue, brute pertinacia pri id. Sed omnium oblique placerat ut, eu etiam vitae nam. Per invenire expetenda dissentiet id, ea alia nostrud detraxit est, est eros intellegebat et.
etere officiis has, nibh quas torquatos pro te. Quo at deleniti repudiandae, et oratio pertinacia ullamcorper quo. Per ut stet assum augue, brute pertinacia pri id. Sed omnium oblique placerat ut, eu etiam vitae nam. Per invenire expetenda dissentiet id, ea alia nostrud detraxit est, est eros intellegebat et.
et oratio pertinacia ullamcorper quo. Per ut stet assum augue, brute pertinacia pri id. Sed omnium oblique placerat ut, eu etiam vitae nam. Per invenire expetenda dissentiet id, ea alia nostrud detraxit est, est eros intellegebat et.
et assum augue, brute pertinacia pri id. Sed omnium oblique placerat ut, eu etiam vitae nam. Per invenire expetenda dissentiet id, ea alia nostrud detraxit est, est eros intellegebat et.
etiam vitae nam. Per invenire expetenda dissentiet id, ea alia nostrud detraxit est, est eros intellegebat et.
etenda dissentiet id, ea alia nostrud detraxit est, est eros intellegebat et.
et id, ea alia nostrud detraxit est, est eros intellegebat et.
etraxit est, est eros intellegebat et.
et.
EOF
EXPECT_ERR=
RUN

NAME=String Search - minimal string - Encoding: ebcdic_uk - Latin
FILE=bins/cmd/search/string_encodings/Latin-Lipsum.ebcdic_uk
CMDS=<<EOF
e search.str.min_length=2
/z "et" l ebcdicuk
# Requires increasing the block size because -.-
b 0x1000
# Check string is actually at offset of the hit.
ps ebcdicuk unprintable @ hit.string.ebcdicuk.0
ps ebcdicuk unprintable @ hit.string.ebcdicuk.1
ps ebcdicuk unprintable @ hit.string.ebcdicuk.2
ps ebcdicuk unprintable @ hit.string.ebcdicuk.3
ps ebcdicuk unprintable @ hit.string.ebcdicuk.4
ps ebcdicuk unprintable @ hit.string.ebcdicuk.5
ps ebcdicuk unprintable @ hit.string.ebcdicuk.6
ps ebcdicuk unprintable @ hit.string.ebcdicuk.7
ps ebcdicuk unprintable @ hit.string.ebcdicuk.8
EOF
EXPECT=<<EOF
0x00000018 2 hit.string.ebcdicuk.0
0x00000042 2 hit.string.ebcdicuk.1
0x0000008f 2 hit.string.ebcdicuk.2
0x000000be 2 hit.string.ebcdicuk.3
0x0000010a 2 hit.string.ebcdicuk.4
0x0000012b 2 hit.string.ebcdicuk.5
0x0000013a 2 hit.string.ebcdicuk.6
0x00000152 2 hit.string.ebcdicuk.7
0x00000175 2 hit.string.ebcdicuk.8
et, at eligendi adipisci ius, ex natum appetere officiis has, nibh quas torquatos pro te. Quo at deleniti repudiandae, et oratio pertinacia ullamcorper quo. Per ut stet assum augue, brute pertinacia pri id. Sed omnium oblique placerat ut, eu etiam vitae nam. Per invenire expetenda dissentiet id, ea alia nostrud detraxit est, est eros intellegebat et.
etere officiis has, nibh quas torquatos pro te. Quo at deleniti repudiandae, et oratio pertinacia ullamcorper quo. Per ut stet assum augue, brute pertinacia pri id. Sed omnium oblique placerat ut, eu etiam vitae nam. Per invenire expetenda dissentiet id, ea alia nostrud detraxit est, est eros intellegebat et.
et oratio pertinacia ullamcorper quo. Per ut stet assum augue, brute pertinacia pri id. Sed omnium oblique placerat ut, eu etiam vitae nam. Per invenire expetenda dissentiet id, ea alia nostrud detraxit est, est eros intellegebat et.
et assum augue, brute pertinacia pri id. Sed omnium oblique placerat ut, eu etiam vitae nam. Per invenire expetenda dissentiet id, ea alia nostrud detraxit est, est eros intellegebat et.
etiam vitae nam. Per invenire expetenda dissentiet id, ea alia nostrud detraxit est, est eros intellegebat et.
etenda dissentiet id, ea alia nostrud detraxit est, est eros intellegebat et.
et id, ea alia nostrud detraxit est, est eros intellegebat et.
etraxit est, est eros intellegebat et.
et.
EOF
EXPECT_ERR=
RUN

NAME=String Search - minimal string - Encoding: ebcdic_us - Latin
FILE=bins/cmd/search/string_encodings/Latin-Lipsum.ebcdic_us
CMDS=<<EOF
e search.str.min_length=2
/z "et" l ebcdicus
# Requires increasing the block size because -.-
b 0x1000
# Check string is actually at offset of the hit.
ps ebcdicus unprintable @ hit.string.ebcdicus.0
ps ebcdicus unprintable @ hit.string.ebcdicus.1
ps ebcdicus unprintable @ hit.string.ebcdicus.2
ps ebcdicus unprintable @ hit.string.ebcdicus.3
ps ebcdicus unprintable @ hit.string.ebcdicus.4
ps ebcdicus unprintable @ hit.string.ebcdicus.5
ps ebcdicus unprintable @ hit.string.ebcdicus.6
ps ebcdicus unprintable @ hit.string.ebcdicus.7
ps ebcdicus unprintable @ hit.string.ebcdicus.8
EOF
EXPECT=<<EOF
0x00000018 2 hit.string.ebcdicus.0
0x00000042 2 hit.string.ebcdicus.1
0x0000008f 2 hit.string.ebcdicus.2
0x000000be 2 hit.string.ebcdicus.3
0x0000010a 2 hit.string.ebcdicus.4
0x0000012b 2 hit.string.ebcdicus.5
0x0000013a 2 hit.string.ebcdicus.6
0x00000152 2 hit.string.ebcdicus.7
0x00000175 2 hit.string.ebcdicus.8
et, at eligendi adipisci ius, ex natum appetere officiis has, nibh quas torquatos pro te. Quo at deleniti repudiandae, et oratio pertinacia ullamcorper quo. Per ut stet assum augue, brute pertinacia pri id. Sed omnium oblique placerat ut, eu etiam vitae nam. Per invenire expetenda dissentiet id, ea alia nostrud detraxit est, est eros intellegebat et.
etere officiis has, nibh quas torquatos pro te. Quo at deleniti repudiandae, et oratio pertinacia ullamcorper quo. Per ut stet assum augue, brute pertinacia pri id. Sed omnium oblique placerat ut, eu etiam vitae nam. Per invenire expetenda dissentiet id, ea alia nostrud detraxit est, est eros intellegebat et.
et oratio pertinacia ullamcorper quo. Per ut stet assum augue, brute pertinacia pri id. Sed omnium oblique placerat ut, eu etiam vitae nam. Per invenire expetenda dissentiet id, ea alia nostrud detraxit est, est eros intellegebat et.
et assum augue, brute pertinacia pri id. Sed omnium oblique placerat ut, eu etiam vitae nam. Per invenire expetenda dissentiet id, ea alia nostrud detraxit est, est eros intellegebat et.
etiam vitae nam. Per invenire expetenda dissentiet id, ea alia nostrud detraxit est, est eros intellegebat et.
etenda dissentiet id, ea alia nostrud detraxit est, est eros intellegebat et.
et id, ea alia nostrud detraxit est, est eros intellegebat et.
etraxit est, est eros intellegebat et.
et.
EOF
EXPECT_ERR=
RUN

NAME=String Search - minimal string - Encoding: ebcdic_es - Latin
FILE=bins/cmd/search/string_encodings/Latin-Lipsum.ebcdic_es
CMDS=<<EOF
e search.str.min_length=2
/z "et" l ebcdices
# Requires increasing the block size because -.-
b 0x1000
# Check string is actually at offset of the hit.
ps ebcdices unprintable @ hit.string.ebcdices.0
ps ebcdices unprintable @ hit.string.ebcdices.1
ps ebcdices unprintable @ hit.string.ebcdices.2
ps ebcdices unprintable @ hit.string.ebcdices.3
ps ebcdices unprintable @ hit.string.ebcdices.4
ps ebcdices unprintable @ hit.string.ebcdices.5
ps ebcdices unprintable @ hit.string.ebcdices.6
ps ebcdices unprintable @ hit.string.ebcdices.7
ps ebcdices unprintable @ hit.string.ebcdices.8
EOF
EXPECT=<<EOF
0x00000018 2 hit.string.ebcdices.0
0x00000042 2 hit.string.ebcdices.1
0x0000008f 2 hit.string.ebcdices.2
0x000000be 2 hit.string.ebcdices.3
0x0000010a 2 hit.string.ebcdices.4
0x0000012b 2 hit.string.ebcdices.5
0x0000013a 2 hit.string.ebcdices.6
0x00000152 2 hit.string.ebcdices.7
0x00000175 2 hit.string.ebcdices.8
et, at eligendi adipisci ius, ex natum appetere officiis has, nibh quas torquatos pro te. Quo at deleniti repudiandae, et oratio pertinacia ullamcorper quo. Per ut stet assum augue, brute pertinacia pri id. Sed omnium oblique placerat ut, eu etiam vitae nam. Per invenire expetenda dissentiet id, ea alia nostrud detraxit est, est eros intellegebat et.
etere officiis has, nibh quas torquatos pro te. Quo at deleniti repudiandae, et oratio pertinacia ullamcorper quo. Per ut stet assum augue, brute pertinacia pri id. Sed omnium oblique placerat ut, eu etiam vitae nam. Per invenire expetenda dissentiet id, ea alia nostrud detraxit est, est eros intellegebat et.
et oratio pertinacia ullamcorper quo. Per ut stet assum augue, brute pertinacia pri id. Sed omnium oblique placerat ut, eu etiam vitae nam. Per invenire expetenda dissentiet id, ea alia nostrud detraxit est, est eros intellegebat et.
et assum augue, brute pertinacia pri id. Sed omnium oblique placerat ut, eu etiam vitae nam. Per invenire expetenda dissentiet id, ea alia nostrud detraxit est, est eros intellegebat et.
etiam vitae nam. Per invenire expetenda dissentiet id, ea alia nostrud detraxit est, est eros intellegebat et.
etenda dissentiet id, ea alia nostrud detraxit est, est eros intellegebat et.
et id, ea alia nostrud detraxit est, est eros intellegebat et.
etraxit est, est eros intellegebat et.
et.
EOF
EXPECT_ERR=
RUN

NAME=String Search - match all - Encoding: ascii - Latin
FILE=bins/cmd/search/string_encodings/Latin-Lipsum.ascii
CMDS=<<EOF
/z "Lorem ipsum dolor sit amet, at eligendi adipisci ius, ex natum appetere officiis has, nibh quas torquatos pro te. Quo at deleniti repudiandae, et oratio pertinacia ullamcorper quo. Per ut stet assum augue, brute pertinacia pri id. Sed omnium oblique placerat ut, eu etiam vitae nam. Per invenire expetenda dissentiet id, ea alia nostrud detraxit est, est eros intellegebat et." l ascii
# Requires increasing the block size because -.-
b 0x1000
# Check string is actually at offset of the hit.
ps ascii unprintable @ hit.string.ascii.0
EOF
EXPECT=<<EOF
0x00000000 376 hit.string.ascii.0
Lorem ipsum dolor sit amet, at eligendi adipisci ius, ex natum appetere officiis has, nibh quas torquatos pro te. Quo at deleniti repudiandae, et oratio pertinacia ullamcorper quo. Per ut stet assum augue, brute pertinacia pri id. Sed omnium oblique placerat ut, eu etiam vitae nam. Per invenire expetenda dissentiet id, ea alia nostrud detraxit est, est eros intellegebat et.
EOF
EXPECT_ERR=
RUN

NAME=String Search - search - Encoding: ibm037 - Latin
FILE=bins/cmd/search/string_encodings/Latin-Lipsum.ibm037
CMDS=<<EOF
/z "eligendi adipisci ius, e" l ibm037
# String detection for ibm037 for ps doesn't work yet.
# ps ascii unprintable @ hit.string.ibm037.0
EOF
EXPECT=<<EOF
0x0000001f 24 hit.string.ibm037.0
EOF
EXPECT_ERR=
RUN

NAME=String Search - search - Encoding: ibm290 - Katakana
FILE=bins/cmd/search/string_encodings/Japanese-Katakana-Lipsum.ibm290
CMDS=<<EOF
# Compile with LITERAL option so * and ) are not interpreted as meta-characters.
/z "!¥*);¬アイウエオカキクケコ" l ibm290
ps ibm290 unprintable @ hit.string.ibm290.0
EOF
EXPECT=<<EOF
0x00000018 16 hit.string.ibm290.0
!¥*);¬アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフ¯ヘホマミムメモヤユヨラリルレロワン゛゜゜
EOF
EXPECT_ERR=
RUN

NAME=String Search - search - Encoding: ibm290 - Use settings (default setting)
FILE=bins/cmd/search/string_encodings/Japanese-Katakana-Lipsum.ibm290
CMDS=<<EOF
e str.encoding=ibm290
/z "!¥*);¬アイウエオカキクケコ"
ps ibm290 unprintable @ hit.string.ibm290.0
EOF
EXPECT=<<EOF
0x00000018 16 hit.string.ibm290.0
!¥*);¬アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフ¯ヘホマミムメモヤユヨラリルレロワン゛゜゜
EOF
EXPECT_ERR=
RUN

NAME=String Search - Encoding: ascii - Latin
FILE=bins/cmd/search/string_encodings/Latin-Lipsum.ascii
CMDS=<<EOF
/z "placerat ut, eu etiam vitae nam" l ascii
# Requires increasing the block size because -.-
b 0x1000
# Check string is actually at offset of the hit.
ps ascii unprintable @ hit.string.ascii.0
EOF
EXPECT=<<EOF
0x000000fa 31 hit.string.ascii.0
placerat ut, eu etiam vitae nam. Per invenire expetenda dissentiet id, ea alia nostrud detraxit est, est eros intellegebat et.
EOF
EXPECT_ERR=
RUN

NAME=String Search - ~[0]
FILE=bins/cmd/search/string_encodings/Latin-Lipsum.ascii
CMDS=<<EOF
e search.show_progress=true
/z "placerat ut, eu etiam vitae nam"~[0]
EOF
EXPECT=<<EOF
0x000000fa
EOF
RUN

NAME=String Search - Encoding: utf8 - Arabic
FILE=bins/cmd/search/string_encodings/Arabic-Lipsum.utf8
CMDS=<<EOF
/z "ا الأوضاع, لم بوابة المب" l utf8
# Requires increasing the block size because -.-
b 0x1000
# Check string is actually at offset of the hit.
ps utf8 unprintable @ hit.string.utf8.0
EOF
EXPECT=<<EOF
0x00000116 43 hit.string.utf8.0
ا الأوضاع, لم بوابة المبرمة عرض. إبّان اسبوعين البشريةً تعد في. كنقطة إيطاليا قام بل, أضف أن وبغطاء الباهضة.
EOF
EXPECT_ERR=
RUN

NAME=String Search - Encoding: utf8 - Armenian
FILE=bins/cmd/search/string_encodings/Armenian-Lipsum.utf8
CMDS=<<EOF
/z "դեֆինիթիոնես ին վիս, ծասե պեռթինա" l utf8
# Requires increasing the block size because -.-
b 0x1000
# Check string is actually at offset of the hit.
ps utf8 unprintable @ hit.string.utf8.0
EOF
EXPECT=<<EOF
0x000001dc 61 hit.string.utf8.0
դեֆինիթիոնես ին վիս, ծասե պեռթինածիա նե վիս. ին մելիուս ֆածիլիս եոս, եսթ եռոս պոպուլո թիմեամ թե. իուս նո ծոնսուլաթու.
EOF
EXPECT_ERR=
RUN

NAME=String Search - Encoding: utf8 - Chinese
FILE=bins/cmd/search/string_encodings/Chinese-Lipsum.utf8
CMDS=<<EOF
/z "京確年禁読応米新報書了号活修佐。" l utf8
# Requires increasing the block size because -.-
b 0x1000
# Check string is actually at offset of the hit.
ps utf8 unprintable @ hit.string.utf8.0
EOF
EXPECT=<<EOF
0x000000de 48 hit.string.utf8.0
京確年禁読応米新報書了号活修佐。央良持著宣込警石寂益好独田接読仕。漂戦辺量食害恐人給景族缶掲価済教放。響城引真際通御芭情査男倍淺早住。金握崎利契事用鹿仮交体受寄終山率大。
EOF
EXPECT_ERR=
RUN

NAME=String Search - Encoding: utf8 - Georgian
FILE=bins/cmd/search/string_encodings/Georgian-Lipsum.utf8
CMDS=<<EOF
/z "რე, იუს ეა უთინამ დელიცათისსიმი. მელ ფერსეყუერის ლ" l utf8
# Requires increasing the block size because -.-
b 0x1000
# Check string is actually at offset of the hit.
ps utf8 unprintable @ hit.string.utf8.0
EOF
EXPECT=<<EOF
0x00000282 132 hit.string.utf8.0
რე, იუს ეა უთინამ დელიცათისსიმი. მელ ფერსეყუერის ლიბერავისსე თე, გრაეცო ფრინციფეს ასსენთიორ სით ეუ. ჰის მალორუმ ანთიოფამ თჰეოფჰრასთუს ნე, ეუ ეუმ ყუას ეთიამ.
EOF
EXPECT_ERR=
RUN

NAME=String Search - Encoding: utf8 - Greek
FILE=bins/cmd/search/string_encodings/Greek-Lipsum.utf8
CMDS=<<EOF
/z "παρτεμ ποσιδονιθμ ατ. Ετ πρι περιcθλισ σπλενδιδε" l utf8
# Requires increasing the block size because -.-
b 0x1000
# Check string is actually at offset of the hit.
ps utf8 unprintable @ hit.string.utf8.0
EOF
EXPECT=<<EOF
0x0000010b 88 hit.string.utf8.0
παρτεμ ποσιδονιθμ ατ. Ετ πρι περιcθλισ σπλενδιδε μνεσαρcηθμ, vελ ατ cονσεqθατ εξπετενδισ. Τε ηασ qθεμ πετεντιθμ.
EOF
EXPECT_ERR=
RUN

NAME=String Search - Encoding: utf8 - Hebrew I
FILE=bins/cmd/search/string_encodings/Hebrew-Lipsum.utf8
CMDS=<<EOF
/z "ים משחקים ממונרכיה" l utf8
# Requires increasing the block size because -.-
b 0x1000
# Check string is actually at offset of the hit.
ps utf8 unprintable @ hit.string.utf8.0
EOF
EXPECT=<<EOF
0x00000141 34 hit.string.utf8.0
ים משחקים ממונרכיה אנא גם.
EOF
EXPECT_ERR=
RUN

NAME=String Search - Encoding: utf8 - Hindi
FILE=bins/cmd/search/string_encodings/Hindi-Lipsum.utf8
CMDS=<<EOF
/z "पहोचने वैश्विक एसलिये पुस्तक हुआआदी" l utf8
# Requires increasing the block size because -.-
b 0x1000
# Check string is actually at offset of the hit.
ps utf8 unprintable @ hit.string.utf8.0
EOF
EXPECT=<<EOF
0x00000086 97 hit.string.utf8.0
पहोचने वैश्विक एसलिये पुस्तक हुआआदी विश्व उनका खरिदने समस्याओ मार्गदर्शन रखते तरीके यायेका विश्लेषण पुष्टिकर्ता चुनने सकता बढाता वेबजाल गोपनीयता लिए। संपादक करेसाथ रचना नवंबर
EOF
EXPECT_ERR=
RUN

NAME=String Search - Encoding: utf8 - Korean2
FILE=bins/cmd/search/string_encodings/Korean2-Lipsum.utf8
CMDS=<<EOF
/z "생의 과실이 있으며." l utf8
# Requires increasing the block size because -.-
b 0x1000
# Check string is actually at offset of the hit.
ps utf8 unprintable @ hit.string.utf8.0
EOF
EXPECT=<<EOF
0x000000dc 27 hit.string.utf8.0
생의 과실이 있으며. 찬미를 사람은 그들에게 너의 청춘이 인류의 그들의 칼이다.
EOF
EXPECT_ERR=
RUN

NAME=String Search - Encoding: utf8 - Morsecode
FILE=bins/cmd/search/string_encodings/Morsecode-Lipsum.utf8
CMDS=<<EOF
/z " ·--· ·---- ··· - ···· --" l utf8
# Requires increasing the block size because -.-
b 0x1000
# Check string is actually at offset of the hit.
ps utf8 unprintable @ hit.string.utf8.0
EOF
EXPECT=<<EOF
0x00000042 35 hit.string.utf8.0
 ·--· ·---- ··· - ···· --·· --··· -· ··· -·· -·-- ···· ·--- ·-·-·- · ··- - ··- ···- ··--- ·-·-·- -·- -··- ----- -·
EOF
EXPECT_ERR=
RUN

NAME=String Search - Encoding: utf8 - Russian
FILE=bins/cmd/search/string_encodings/Russian-Lipsum.utf8
CMDS=<<EOF
/z "тани ад. Цум хендрерит перс" l utf8
# Requires increasing the block size because -.-
b 0x1000
# Check string is actually at offset of the hit.
ps utf8 unprintable @ hit.string.utf8.0
EOF
EXPECT=<<EOF
0x00000055 49 hit.string.utf8.0
тани ад. Цум хендрерит персецути ех, миним еяуидем цонсецтетуер яуи ид. Либер малуиссет нам еа, еа граеце дефиниебас.
EOF
EXPECT_ERR=
RUN

NAME=String Search - Encoding: utf16be - Arabic
FILE=bins/cmd/search/string_encodings/Arabic-Lipsum.utf16be
CMDS=<<EOF
/z "ا الأوضاع, لم بوابة المب" l utf16be
# Requires increasing the block size because -.-
b 0x1000
# Check string is actually at offset of the hit.
ps utf16be unprintable @ hit.string.utf16be.0
EOF
EXPECT=<<EOF
0x00000138 48 hit.string.utf16be.0
ا الأوضاع, لم بوابة المبرمة عرض. إبّان اسبوعين البشريةً تعد في. كنقطة إيطاليا قام بل, أضف أن وبغطاء الباهضة.
EOF
EXPECT_ERR=
RUN

NAME=String Search - Encoding: utf16be - Armenian
FILE=bins/cmd/search/string_encodings/Armenian-Lipsum.utf16be
CMDS=<<EOF
/z "դեֆինիթիոնես ին վիս, ծասե պեռթինա" l utf16be
# Requires increasing the block size because -.-
b 0x1000
# Check string is actually at offset of the hit.
ps utf16be unprintable @ hit.string.utf16be.0
EOF
EXPECT=<<EOF
0x0000020c 66 hit.string.utf16be.0
դեֆինիթիոնես ին վիս, ծասե պեռթինածիա նե վիս. ին մելիուս ֆածիլիս եոս, եսթ եռոս պոպուլո թիմեամ թե. իուս նո ծոնսուլաթու.
EOF
EXPECT_ERR=
RUN

NAME=String Search - Encoding: utf16be - Chinese
FILE=bins/cmd/search/string_encodings/Chinese-Lipsum.utf16be
CMDS=<<EOF
/z "京確年禁読応米新報書了号活修佐。" l utf16be
# Requires increasing the block size because -.-
b 0x1000
# Check string is actually at offset of the hit.
ps utf16be unprintable @ hit.string.utf16be.0
EOF
EXPECT=<<EOF
0x00000094 32 hit.string.utf16be.0
京確年禁読応米新報書了号活修佐。央良持著宣込警石寂益好独田接読仕。漂戦辺量食害恐人給景族缶掲価済教放。響城引真際通御芭情査男倍淺早住。金握崎利契事用鹿仮交体受寄終山率大。
EOF
EXPECT_ERR=
RUN

NAME=String Search - Encoding: utf16be - Georgian
FILE=bins/cmd/search/string_encodings/Georgian-Lipsum.utf16be
CMDS=<<EOF
/z "რე, იუს ეა უთინამ დელიცათისსიმი. მელ ფერსეყუერის ლ" l utf16be
# Requires increasing the block size because -.-
b 0x1000
# Check string is actually at offset of the hit.
ps utf16be unprintable @ hit.string.utf16be.0
EOF
EXPECT=<<EOF
0x000001ec 100 hit.string.utf16be.0
რე, იუს ეა უთინამ დელიცათისსიმი. მელ ფერსეყუერის ლიბერავისსე თე, გრაეცო ფრინციფეს ასსენთიორ სით ეუ. ჰის მალორუმ ანთიოფამ თჰეოფჰრასთუს ნე, ეუ ეუმ ყუას ეთიამ.
EOF
EXPECT_ERR=
RUN

NAME=String Search - Encoding: utf16be - Greek
FILE=bins/cmd/search/string_encodings/Greek-Lipsum.utf16be
CMDS=<<EOF
/z "παρτεμ ποσιδονιθμ ατ. Ετ πρι περιcθλισ σπλενδιδε" l utf16be
# Requires increasing the block size because -.-
b 0x1000
# Check string is actually at offset of the hit.
ps utf16be unprintable @ hit.string.utf16be.0
EOF
EXPECT=<<EOF
0x0000012c 96 hit.string.utf16be.0
παρτεμ ποσιδονιθμ ατ. Ετ πρι περιcθλισ σπλενδιδε μνεσαρcηθμ, vελ ατ cονσεqθατ εξπετενδισ. Τε ηασ qθεμ πετεντιθμ.
EOF
EXPECT_ERR=
RUN

NAME=String Search - Encoding: utf16be - Hebrew I
FILE=bins/cmd/search/string_encodings/Hebrew-Lipsum.utf16be
CMDS=<<EOF
/z "ים משחקים ממונרכיה" l utf16be
# Requires increasing the block size because -.-
b 0x1000
# Check string is actually at offset of the hit.
ps utf16be unprintable @ hit.string.utf16be.0
EOF
EXPECT=<<EOF
0x00000168 36 hit.string.utf16be.0
ים משחקים ממונרכיה אנא גם.
EOF
EXPECT_ERR=
RUN

NAME=String Search - Encoding: utf16be - Hindi
FILE=bins/cmd/search/string_encodings/Hindi-Lipsum.utf16be
CMDS=<<EOF
/z "पहोचने वैश्विक एसलिये पुस्तक हुआआदी" l utf16be
# Requires increasing the block size because -.-
b 0x1000
# Check string is actually at offset of the hit.
ps utf16be unprintable @ hit.string.utf16be.0
EOF
EXPECT=<<EOF
0x00000064 70 hit.string.utf16be.0
पहोचने वैश्विक एसलिये पुस्तक हुआआदी विश्व उनका खरिदने समस्याओ मार्गदर्शन रखते तरीके यायेका विश्लेषण पुष्टिकर्ता चुनने सकता बढाता वेबजाल गोपनीयता लिए। संपादक करेसाथ रचना नवंबर
EOF
EXPECT_ERR=
RUN

NAME=String Search - Encoding: utf16be - Korean2
FILE=bins/cmd/search/string_encodings/Korean2-Lipsum.utf16be
CMDS=<<EOF
/z "생의 과실이 있으며." l utf16be
# Requires increasing the block size because -.-
b 0x1000
# Check string is actually at offset of the hit.
ps utf16be unprintable @ hit.string.utf16be.0
EOF
EXPECT=<<EOF
0x000000bc 22 hit.string.utf16be.0
생의 과실이 있으며. 찬미를 사람은 그들에게 너의 청춘이 인류의 그들의 칼이다.
EOF
EXPECT_ERR=
RUN

NAME=String Search - Encoding: utf16be - Morsecode
FILE=bins/cmd/search/string_encodings/Morsecode-Lipsum.utf16be
CMDS=<<EOF
/z " ·--· ·---- ··· - ···· --" l utf16be
# Requires increasing the block size because -.-
b 0x1000
# Check string is actually at offset of the hit.
ps utf16be unprintable @ hit.string.utf16be.0
EOF
EXPECT=<<EOF
0x0000005c 50 hit.string.utf16be.0
 ·--· ·---- ··· - ···· --·· --··· -· ··· -·· -·-- ···· ·--- ·-·-·- · ··- - ··- ···- ··--- ·-·-·- -·- -··- ----- -·
EOF
EXPECT_ERR=
RUN

NAME=String Search - Encoding: utf16be - Russian
FILE=bins/cmd/search/string_encodings/Russian-Lipsum.utf16be
CMDS=<<EOF
/z "тани ад. Цум хендрерит перс" l utf16be
# Requires increasing the block size because -.-
b 0x1000
# Check string is actually at offset of the hit.
ps utf16be unprintable @ hit.string.utf16be.0
EOF
EXPECT=<<EOF
0x0000005e 54 hit.string.utf16be.0
тани ад. Цум хендрерит персецути ех, миним еяуидем цонсецтетуер яуи ид. Либер малуиссет нам еа, еа граеце дефиниебас.
EOF
EXPECT_ERR=
RUN

NAME=String Search - Encoding: utf16le - Arabic
FILE=bins/cmd/search/string_encodings/Arabic-Lipsum.utf16le
CMDS=<<EOF
/z "ا الأوضاع, لم بوابة المب" l utf16le
# Requires increasing the block size because -.-
b 0x1000
# Check string is actually at offset of the hit.
# psutf1 unprintable @ hit.string.utf16le.0
EOF
EXPECT=<<EOF
0x00000138 48 hit.string.utf16le.0
EOF
EXPECT_ERR=
RUN

NAME=String Search - Encoding: utf16le - Armenian
FILE=bins/cmd/search/string_encodings/Armenian-Lipsum.utf16le
CMDS=<<EOF
/z "դեֆինիթիոնես ին վիս, ծասե պեռթինա" l utf16le
# Requires increasing the block size because -.-
b 0x1000
# Check string is actually at offset of the hit.
ps utf16le unprintable @ hit.string.utf16le.0
EOF
EXPECT=<<EOF
0x0000020c 66 hit.string.utf16le.0
դեֆինիթիոնես ին վիս, ծասե պեռթինածիա նե վիս. ին մելիուս ֆածիլիս եոս, եսթ եռոս պոպուլո թիմեամ թե. իուս նո ծոնսուլաթու.
EOF
EXPECT_ERR=
RUN

NAME=String Search - Encoding: utf16le - Chinese
FILE=bins/cmd/search/string_encodings/Chinese-Lipsum.utf16le
CMDS=<<EOF
/z "京確年禁読応米新報書了号活修佐。" l utf16le
# Requires increasing the block size because -.-
b 0x1000
# Check string is actually at offset of the hit.
ps utf16le unprintable @ hit.string.utf16le.0
EOF
EXPECT=<<EOF
0x00000094 32 hit.string.utf16le.0
京確年禁読応米新報書了号活修佐。央良持著宣込警石寂益好独田接読仕。漂戦辺量食害恐人給景族缶掲価済教放。響城引真際通御芭情査男倍淺早住。金握崎利契事用鹿仮交体受寄終山率大。
EOF
EXPECT_ERR=
RUN

NAME=String Search - Encoding: utf16le - Georgian
FILE=bins/cmd/search/string_encodings/Georgian-Lipsum.utf16le
CMDS=<<EOF
/z "რე, იუს ეა უთინამ დელიცათისსიმი. მელ ფერსეყუერის ლ" l utf16le
# Requires increasing the block size because -.-
b 0x1000
# Check string is actually at offset of the hit.
ps utf16le unprintable @ hit.string.utf16le.0
EOF
EXPECT=<<EOF
0x000001ec 100 hit.string.utf16le.0
რე, იუს ეა უთინამ დელიცათისსიმი. მელ ფერსეყუერის ლიბერავისსე თე, გრაეცო ფრინციფეს ასსენთიორ სით ეუ. ჰის მალორუმ ანთიოფამ თჰეოფჰრასთუს ნე, ეუ ეუმ ყუას ეთიამ.
EOF
EXPECT_ERR=
RUN

NAME=String Search - Encoding: utf16le - Greek
FILE=bins/cmd/search/string_encodings/Greek-Lipsum.utf16le
CMDS=<<EOF
/z "παρτεμ ποσιδονιθμ ατ. Ετ πρι περιcθλισ σπλενδιδε" l utf16le
# Requires increasing the block size because -.-
b 0x1000
# Check string is actually at offset of the hit.
ps utf16le unprintable @ hit.string.utf16le.0
EOF
EXPECT=<<EOF
0x0000012c 96 hit.string.utf16le.0
παρτεμ ποσιδονιθμ ατ. Ετ πρι περιcθλισ σπλενδιδε μνεσαρcηθμ, vελ ατ cονσεqθατ εξπετενδισ. Τε ηασ qθεμ πετεντιθμ.
EOF
EXPECT_ERR=
RUN

NAME=String Search - Encoding: utf16le - Hebrew I
FILE=bins/cmd/search/string_encodings/Hebrew-Lipsum.utf16le
CMDS=<<EOF
/z "ים משחקים ממונרכיה" l utf16le
# Requires increasing the block size because -.-
b 0x1000
# Check string is actually at offset of the hit.
ps utf16le unprintable @ hit.string.utf16le.0
EOF
EXPECT=<<EOF
0x00000168 36 hit.string.utf16le.0
ים משחקים ממונרכיה אנא גם.
EOF
EXPECT_ERR=
RUN

NAME=String Search - Encoding: utf16le - Hindi
FILE=bins/cmd/search/string_encodings/Hindi-Lipsum.utf16le
CMDS=<<EOF
/z "पहोचने वैश्विक एसलिये पुस्तक हुआआदी" l utf16le
# Requires increasing the block size because -.-
b 0x1000
# Check string is actually at offset of the hit.
ps utf16le unprintable @ hit.string.utf16le.0
EOF
EXPECT=<<EOF
0x00000064 70 hit.string.utf16le.0
पहोचने वैश्विक एसलिये पुस्तक हुआआदी विश्व उनका खरिदने समस्याओ मार्गदर्शन रखते तरीके यायेका विश्लेषण पुष्टिकर्ता चुनने सकता बढाता वेबजाल गोपनीयता लिए। संपादक करेसाथ रचना नवंबर
EOF
EXPECT_ERR=
RUN

NAME=String Search - Encoding: utf16le - Korean2
FILE=bins/cmd/search/string_encodings/Korean2-Lipsum.utf16le
CMDS=<<EOF
/z "생의 과실이 있으며." l utf16le
# Requires increasing the block size because -.-
b 0x1000
# Check string is actually at offset of the hit.
ps utf16le unprintable @ hit.string.utf16le.0
EOF
EXPECT=<<EOF
0x000000bc 22 hit.string.utf16le.0
생의 과실이 있으며. 찬미를 사람은 그들에게 너의 청춘이 인류의 그들의 칼이다.
EOF
EXPECT_ERR=
RUN

NAME=String Search - Encoding: utf16le - Morsecode
FILE=bins/cmd/search/string_encodings/Morsecode-Lipsum.utf16le
CMDS=<<EOF
/z " ·--· ·---- ··· - ···· --" l utf16le
# Requires increasing the block size because -.-
b 0x1000
# Check string is actually at offset of the hit.
ps utf16le unprintable @ hit.string.utf16le.0
EOF
EXPECT=<<EOF
0x0000005c 50 hit.string.utf16le.0
 ·--· ·---- ··· - ···· --·· --··· -· ··· -·· -·-- ···· ·--- ·-·-·- · ··- - ··- ···- ··--- ·-·-·- -·- -··- ----- -·
EOF
EXPECT_ERR=
RUN

NAME=String Search - Encoding: utf16le - Russian
FILE=bins/cmd/search/string_encodings/Russian-Lipsum.utf16le
CMDS=<<EOF
/z "тани ад. Цум хендрерит перс" l utf16le
# Requires increasing the block size because -.-
b 0x1000
# Check string is actually at offset of the hit.
ps utf16le unprintable @ hit.string.utf16le.0
EOF
EXPECT=<<EOF
0x0000005e 54 hit.string.utf16le.0
тани ад. Цум хендрерит персецути ех, миним еяуидем цонсецтетуер яуи ид. Либер малуиссет нам еа, еа граеце дефиниебас.
EOF
EXPECT_ERR=
RUN

NAME=String Search - Encoding: utf32be - Arabic
FILE=bins/cmd/search/string_encodings/Arabic-Lipsum.utf32be
CMDS=<<EOF
/z "ا الأوضاع, لم بوابة المب" l utf32be
# Requires increasing the block size because -.-
b 0x1000
# Check string is actually at offset of the hit.
ps utf32be unprintable @ hit.string.utf32be.0
EOF
EXPECT=<<EOF
0x00000270 96 hit.string.utf32be.0
ا الأوضاع, لم بوابة المبرمة عرض. إبّان اسبوعين البشريةً تعد في. كنقطة إيطاليا قام بل, أضف أن وبغطاء الباهضة.
EOF
EXPECT_ERR=
RUN

NAME=String Search - Encoding: utf32be - Armenian
FILE=bins/cmd/search/string_encodings/Armenian-Lipsum.utf32be
CMDS=<<EOF
/z "դեֆինիթիոնես ին վիս, ծասե պեռթինա" l utf32be
# Requires increasing the block size because -.-
b 0x1000
# Check string is actually at offset of the hit.
ps utf32be unprintable @ hit.string.utf32be.0
EOF
EXPECT=<<EOF
0x00000418 132 hit.string.utf32be.0
դեֆինիթիոնես ին վիս, ծասե պեռթինածիա նե վիս. ին մելիուս ֆածիլիս եոս, եսթ եռոս պոպուլո թիմեամ թե. իուս նո ծոնսուլաթու.
EOF
EXPECT_ERR=
RUN

NAME=String Search - Encoding: utf32be - Chinese
FILE=bins/cmd/search/string_encodings/Chinese-Lipsum.utf32be
CMDS=<<EOF
/z "京確年禁読応米新報書了号活修佐。" l utf32be
# Requires increasing the block size because -.-
b 0x1000
# Check string is actually at offset of the hit.
ps utf32be unprintable @ hit.string.utf32be.0
EOF
EXPECT=<<EOF
0x00000128 64 hit.string.utf32be.0
京確年禁読応米新報書了号活修佐。央良持著宣込警石寂益好独田接読仕。漂戦辺量食害恐人給景族缶掲価済教放。響城引真際通御芭情査男倍淺早住。金握崎利契事用鹿仮交体受寄終山率大。
EOF
EXPECT_ERR=
RUN

NAME=String Search - Encoding: utf32be - Georgian
FILE=bins/cmd/search/string_encodings/Georgian-Lipsum.utf32be
CMDS=<<EOF
/z "რე, იუს ეა უთინამ დელიცათისსიმი. მელ ფერსეყუერის ლ" l utf32be
# Requires increasing the block size because -.-
b 0x1000
# Check string is actually at offset of the hit.
ps utf32be unprintable @ hit.string.utf32be.0
EOF
EXPECT=<<EOF
0x000003d8 200 hit.string.utf32be.0
რე, იუს ეა უთინამ დელიცათისსიმი. მელ ფერსეყუერის ლიბერავისსე თე, გრაეცო ფრინციფეს ასსენთიორ სით ეუ. ჰის მალორუმ ანთიოფამ თჰეოფჰრასთუს ნე, ეუ ეუმ ყუას ეთიამ.
EOF
EXPECT_ERR=
RUN

NAME=String Search - Encoding: utf32be - Greek
FILE=bins/cmd/search/string_encodings/Greek-Lipsum.utf32be
CMDS=<<EOF
/z "παρτεμ ποσιδονιθμ ατ. Ετ πρι περιcθλισ σπλενδιδε" l utf32be
# Requires increasing the block size because -.-
b 0x1000
# Check string is actually at offset of the hit.
ps utf32be unprintable @ hit.string.utf32be.0
EOF
EXPECT=<<EOF
0x00000258 192 hit.string.utf32be.0
παρτεμ ποσιδονιθμ ατ. Ετ πρι περιcθλισ σπλενδιδε μνεσαρcηθμ, vελ ατ cονσεqθατ εξπετενδισ. Τε ηασ qθεμ πετεντιθμ.
EOF
EXPECT_ERR=
RUN

NAME=String Search - Encoding: utf32be - Hebrew I
FILE=bins/cmd/search/string_encodings/Hebrew-Lipsum.utf32be
CMDS=<<EOF
/z "ים משחקים ממונרכיה" l utf32be
# Requires increasing the block size because -.-
b 0x1000
# Check string is actually at offset of the hit.
ps utf32be unprintable @ hit.string.utf32be.0
EOF
EXPECT=<<EOF
0x000002d0 72 hit.string.utf32be.0
ים משחקים ממונרכיה אנא גם.
EOF
EXPECT_ERR=
RUN

NAME=String Search - Encoding: utf32be - Hindi
FILE=bins/cmd/search/string_encodings/Hindi-Lipsum.utf32be
CMDS=<<EOF
/z "पहोचने वैश्विक एसलिये पुस्तक हुआआदी" l utf32be
# Requires increasing the block size because -.-
b 0x1000
# Check string is actually at offset of the hit.
ps utf32be unprintable @ hit.string.utf32be.0
EOF
EXPECT=<<EOF
0x000000c8 140 hit.string.utf32be.0
पहोचने वैश्विक एसलिये पुस्तक हुआआदी विश्व उनका खरिदने समस्याओ मार्गदर्शन रखते तरीके यायेका विश्लेषण पुष्टिकर्ता चुनने सकता बढाता वेबजाल गोपनीयता लिए। संपादक करेसाथ रचना नवंबर
EOF
EXPECT_ERR=
RUN

NAME=String Search - Encoding: utf32be - Korean2
FILE=bins/cmd/search/string_encodings/Korean2-Lipsum.utf32be
CMDS=<<EOF
/z "생의 과실이 있으며." l utf32be
# Requires increasing the block size because -.-
b 0x1000
# Check string is actually at offset of the hit.
ps utf32be unprintable @ hit.string.utf32be.0
EOF
EXPECT=<<EOF
0x00000178 44 hit.string.utf32be.0
생의 과실이 있으며. 찬미를 사람은 그들에게 너의 청춘이 인류의 그들의 칼이다.
EOF
EXPECT_ERR=
RUN

NAME=String Search - Encoding: utf32be - Morsecode
FILE=bins/cmd/search/string_encodings/Morsecode-Lipsum.utf32be
CMDS=<<EOF
/z " ·--· ·---- ··· - ···· --" l utf32be
# Requires increasing the block size because -.-
b 0x1000
# Check string is actually at offset of the hit.
ps utf32be unprintable @ hit.string.utf32be.0
EOF
EXPECT=<<EOF
0x000000b8 100 hit.string.utf32be.0
 ·--· ·---- ··· - ···· --·· --··· -· ··· -·· -·-- ···· ·--- ·-·-·- · ··- - ··- ···- ··--- ·-·-·- -·- -··- ----- -·
EOF
EXPECT_ERR=
RUN

NAME=String Search - Encoding: utf32be - Russian
FILE=bins/cmd/search/string_encodings/Russian-Lipsum.utf32be
CMDS=<<EOF
/z "тани ад. Цум хендрерит перс" l utf32be
# Requires increasing the block size because -.-
b 0x1000
# Check string is actually at offset of the hit.
ps utf32be unprintable @ hit.string.utf32be.0
EOF
EXPECT=<<EOF
0x000000bc 108 hit.string.utf32be.0
тани ад. Цум хендрерит персецути ех, миним еяуидем цонсецтетуер яуи ид. Либер малуиссет нам еа, еа граеце дефиниебас.
EOF
EXPECT_ERR=
RUN

NAME=String Search - Encoding: utf32le - Arabic
FILE=bins/cmd/search/string_encodings/Arabic-Lipsum.utf32le
CMDS=<<EOF
/z "ا الأوضاع, لم بوابة المب" l utf32le
# Requires increasing the block size because -.-
b 0x1000
# Check string is actually at offset of the hit.
# psutf3 unprintable @ hit.string.utf32le.0
EOF
EXPECT=<<EOF
0x00000270 96 hit.string.utf32le.0
EOF
EXPECT_ERR=
RUN

NAME=String Search - Encoding: utf32le - Armenian
FILE=bins/cmd/search/string_encodings/Armenian-Lipsum.utf32le
CMDS=<<EOF
/z "դեֆինիթիոնես ին վիս, ծասե պեռթինա" l utf32le
# Requires increasing the block size because -.-
b 0x1000
# Check string is actually at offset of the hit.
ps utf32le unprintable @ hit.string.utf32le.0
EOF
EXPECT=<<EOF
0x00000418 132 hit.string.utf32le.0
դեֆինիթիոնես ին վիս, ծասե պեռթինածիա նե վիս. ին մելիուս ֆածիլիս եոս, եսթ եռոս պոպուլո թիմեամ թե. իուս նո ծոնսուլաթու.
EOF
EXPECT_ERR=
RUN

NAME=String Search - Encoding: utf32le - Chinese
FILE=bins/cmd/search/string_encodings/Chinese-Lipsum.utf32le
CMDS=<<EOF
/z "京確年禁読応米新報書了号活修佐。" l utf32le
# Requires increasing the block size because -.-
b 0x1000
# Check string is actually at offset of the hit.
ps utf32le unprintable @ hit.string.utf32le.0
EOF
EXPECT=<<EOF
0x00000128 64 hit.string.utf32le.0
京確年禁読応米新報書了号活修佐。央良持著宣込警石寂益好独田接読仕。漂戦辺量食害恐人給景族缶掲価済教放。響城引真際通御芭情査男倍淺早住。金握崎利契事用鹿仮交体受寄終山率大。
EOF
EXPECT_ERR=
RUN

NAME=String Search - Encoding: utf32le - Georgian
FILE=bins/cmd/search/string_encodings/Georgian-Lipsum.utf32le
CMDS=<<EOF
/z "რე, იუს ეა უთინამ დელიცათისსიმი. მელ ფერსეყუერის ლ" l utf32le
# Requires increasing the block size because -.-
b 0x1000
# Check string is actually at offset of the hit.
ps utf32le unprintable @ hit.string.utf32le.0
EOF
EXPECT=<<EOF
0x000003d8 200 hit.string.utf32le.0
რე, იუს ეა უთინამ დელიცათისსიმი. მელ ფერსეყუერის ლიბერავისსე თე, გრაეცო ფრინციფეს ასსენთიორ სით ეუ. ჰის მალორუმ ანთიოფამ თჰეოფჰრასთუს ნე, ეუ ეუმ ყუას ეთიამ.
EOF
EXPECT_ERR=
RUN

NAME=String Search - Encoding: utf32le - Greek
FILE=bins/cmd/search/string_encodings/Greek-Lipsum.utf32le
CMDS=<<EOF
/z "παρτεμ ποσιδονιθμ ατ. Ετ πρι περιcθλισ σπλενδιδε" l utf32le
# Requires increasing the block size because -.-
b 0x1000
# Check string is actually at offset of the hit.
ps utf32le unprintable @ hit.string.utf32le.0
EOF
EXPECT=<<EOF
0x00000258 192 hit.string.utf32le.0
παρτεμ ποσιδονιθμ ατ. Ετ πρι περιcθλισ σπλενδιδε μνεσαρcηθμ, vελ ατ cονσεqθατ εξπετενδισ. Τε ηασ qθεμ πετεντιθμ.
EOF
EXPECT_ERR=
RUN

NAME=String Search - Encoding: utf32le - Hebrew I
FILE=bins/cmd/search/string_encodings/Hebrew-Lipsum.utf32le
CMDS=<<EOF
/z "ים משחקים ממונרכיה" l utf32le
# Requires increasing the block size because -.-
b 0x1000
# Check string is actually at offset of the hit.
ps utf32le unprintable @ hit.string.utf32le.0
EOF
EXPECT=<<EOF
0x000002d0 72 hit.string.utf32le.0
ים משחקים ממונרכיה אנא גם.
EOF
EXPECT_ERR=
RUN

NAME=String Search - Encoding: utf32le - Hindi
FILE=bins/cmd/search/string_encodings/Hindi-Lipsum.utf32le
CMDS=<<EOF
/z "पहोचने वैश्विक एसलिये पुस्तक हुआआदी" l utf32le
# Requires increasing the block size because -.-
b 0x1000
# Check string is actually at offset of the hit.
ps utf32le unprintable @ hit.string.utf32le.0
EOF
EXPECT=<<EOF
0x000000c8 140 hit.string.utf32le.0
पहोचने वैश्विक एसलिये पुस्तक हुआआदी विश्व उनका खरिदने समस्याओ मार्गदर्शन रखते तरीके यायेका विश्लेषण पुष्टिकर्ता चुनने सकता बढाता वेबजाल गोपनीयता लिए। संपादक करेसाथ रचना नवंबर
EOF
EXPECT_ERR=
RUN

NAME=String Search - Encoding: utf32le - Korean2
FILE=bins/cmd/search/string_encodings/Korean2-Lipsum.utf32le
CMDS=<<EOF
/z "생의 과실이 있으며." l utf32le
# Requires increasing the block size because -.-
b 0x1000
# Check string is actually at offset of the hit.
ps utf32le unprintable @ hit.string.utf32le.0
EOF
EXPECT=<<EOF
0x00000178 44 hit.string.utf32le.0
생의 과실이 있으며. 찬미를 사람은 그들에게 너의 청춘이 인류의 그들의 칼이다.
EOF
EXPECT_ERR=
RUN

NAME=String Search - Encoding: utf32le - Morsecode
FILE=bins/cmd/search/string_encodings/Morsecode-Lipsum.utf32le
CMDS=<<EOF
/z " ·--· ·---- ··· - ···· --" l utf32le
# Requires increasing the block size because -.-
b 0x1000
# Check string is actually at offset of the hit.
ps utf32le unprintable @ hit.string.utf32le.0
EOF
EXPECT=<<EOF
0x000000b8 100 hit.string.utf32le.0
 ·--· ·---- ··· - ···· --·· --··· -· ··· -·· -·-- ···· ·--- ·-·-·- · ··- - ··- ···- ··--- ·-·-·- -·- -··- ----- -·
EOF
EXPECT_ERR=
RUN

NAME=String Search - Encoding: utf32le - Russian
FILE=bins/cmd/search/string_encodings/Russian-Lipsum.utf32le
CMDS=<<EOF
/z "тани ад. Цум хендрерит перс" l utf32le
# Requires increasing the block size because -.-
b 0x1000
# Check string is actually at offset of the hit.
ps utf32le unprintable @ hit.string.utf32le.0
EOF
EXPECT=<<EOF
0x000000bc 108 hit.string.utf32le.0
тани ад. Цум хендрерит персецути ех, миним еяуидем цонсецтетуер яуи ид. Либер малуиссет нам еа, еа граеце дефиниебас.
EOF
EXPECT_ERR=
RUN

NAME=Regex Search case insensitive - Encoding: Unicode utf8, utf32le, utf16be - Russian
FILE=bins/cmd/search/string_encodings/regex_search.russian.utf8.utf32le.utf16be
CMDS=<<EOF
/z "ипсум" i utf8
# Requires increasing the block size because -.-
b 0x1000
# Check string is actually at offset of the hit.
ps utf8 unprintable @ hit.string.utf8.0
ps utf8 unprintable @ hit.string.utf8.1
EOF
EXPECT=<<EOF
0x0000000b 10 hit.string.utf8.0
0x00000042 10 hit.string.utf8.1
ипсум долор сит амет
ИПСУМ ДОЛОР СИТ АМЕТ
EOF
EXPECT_ERR=
RUN

NAME=String search extended regex - Encoding: Unicode utf8, utf32le, utf16be - Russian
FILE=bins/cmd/search/string_encodings/regex_search.russian.utf8.utf32le.utf16be
CMDS=<<EOF
/z "и.{3}м" e utf32le
# Requires increasing the block size because -.-
b 0x1000
# Check string is actually at offset of the hit.
ps utf32le unprintable @ hit.string.utf32le.0
ps utf32le unprintable @ hit.string.utf32le.1
EOF
EXPECT=<<EOF
0x00000087 20 hit.string.utf32le.0
0x000000bb 20 hit.string.utf32le.1
ипсум долор сит амет, при унум семпер тритани ад. Цум хендрерит персецути ех, миним еяуидем цонсецтетуер яуи ид. Либер малуиссет нам еа, еа граеце дефиниебас.
ит амет, при унум семпер тритани ад. Цум хендрерит персецути ех, миним еяуидем цонсецтетуер яуи ид. Либер малуиссет нам еа, еа граеце дефиниебас.
EOF
EXPECT_ERR=
RUN

NAME=String search regex case insensitive - Encoding: Unicode utf8, utf32le, utf16be - Russian
FILE=bins/cmd/search/string_encodings/regex_search.russian.utf8.utf32le.utf16be
CMDS=<<EOF
/z "и.{3}м" ei utf8
# Requires increasing the block size because -.-
b 0x1000
# Check string is actually at offset of the hit.
ps utf8 unprintable @ hit.string.utf8.0
ps utf8 unprintable @ hit.string.utf8.1
ps utf8 unprintable @ hit.string.utf8.2
ps utf8 unprintable @ hit.string.utf8.3
EOF
EXPECT=<<EOF
0x0000000b 10 hit.string.utf8.0
0x00000023 9 hit.string.utf8.1
0x00000042 10 hit.string.utf8.2
0x0000005a 9 hit.string.utf8.3
ипсум долор сит амет
ит амет
ИПСУМ ДОЛОР СИТ АМЕТ
ИТ АМЕТ
EOF
EXPECT_ERR=
RUN

NAME=String search regex - utf16be
FILE=bins/cmd/search/string_encodings/Russian-Lipsum.utf16be
CMDS=<<EOF
# Requires increasing the block size because -.-
b 0x1000
/z "Л..е." e utf16be
ps utf16be unprintable @ hit.string.utf16be.0
ps utf16be unprintable @ hit.string.utf16be.1
EOF
EXPECT=<<EOF
0x00000000 10 hit.string.utf16be.0
0x000000ee 10 hit.string.utf16be.1
Лорем ипсум долор сит амет, при унум семпер тритани ад. Цум хендрерит персецути ех, миним еяуидем цонсецтетуер яуи ид. Либер малуиссет нам еа, еа граеце дефиниебас.
Либер малуиссет нам еа, еа граеце дефиниебас.
EOF
EXPECT_ERR=
RUN

NAME=String search regex - utf32le
FILE=bins/cmd/search/string_encodings/Russian-Lipsum.utf32le
CMDS=<<EOF
# Requires increasing the block size because -.-
b 0x1000
/z "Л..е." e utf32le
ps utf32le unprintable @ hit.string.utf32le.0
ps utf32le unprintable @ hit.string.utf32le.1
EOF
EXPECT=<<EOF
0x00000000 20 hit.string.utf32le.0
0x000001dc 20 hit.string.utf32le.1
Лорем ипсум долор сит амет, при унум семпер тритани ад. Цум хендрерит персецути ех, миним еяуидем цонсецтетуер яуи ид. Либер малуиссет нам еа, еа граеце дефиниебас.
Либер малуиссет нам еа, еа граеце дефиниебас.
EOF
EXPECT_ERR=
RUN


NAME=String search regex - utf32le
FILE=bins/cmd/search/string_encodings/Russian-Lipsum.utf32le
CMDS=<<EOF
# Requires increasing the block size because -.-
b 0x1000
/z "Л..е." e utf32le
ps utf32le unprintable @ hit.string.utf32le.0
ps utf32le unprintable @ hit.string.utf32le.1
e search.align=0x100
echo Alignment=0x100
/z "Л..е." e utf32le
ps utf32le unprintable @ hit.string.utf32le.0
EOF
EXPECT=<<EOF
0x00000000 20 hit.string.utf32le.0
0x000001dc 20 hit.string.utf32le.1
Лорем ипсум долор сит амет, при унум семпер тритани ад. Цум хендрерит персецути ех, миним еяуидем цонсецтетуер яуи ид. Либер малуиссет нам еа, еа граеце дефиниебас.
Либер малуиссет нам еа, еа граеце дефиниебас.
Alignment=0x100
0x00000000 20 hit.string.utf32le.0
Лорем ипсум долор сит амет, при унум семпер тритани ад. Цум хендрерит персецути ех, миним еяуидем цонсецтетуер яуи ид. Либер малуиссет нам еа, еа граеце дефиниебас.
EOF
EXPECT_ERR=
RUN

NAME=String search alignment
FILE=bins/cmd/search/alignment_test
ARGS=
CMDS=<<EOF
/z b[ba].bb r~$[0]
e search.align=2
echo Alignment=2
/z b[ba].bb r~$[0]
e search.align=4
echo Alignment=4
/z b[ba].bb r~$[0]
e search.align=16
echo Alignment=16
/z b[ba].bb r~$[0]
EOF
EXPECT=<<EOF
0x00000024
0x00000032
0x00000040
0x00000052
0x0000005a
Alignment=2
0x00000024
0x00000032
0x00000040
0x00000052
0x0000005a
Alignment=4
0x00000024
0x00000040
Alignment=16
0x00000040
EOF
RUN

NAME=String Search - minimal string - Encoding: ebcdic_uk - Latin
FILE=bins/cmd/search/string_encodings/Latin-Lipsum.ebcdic_uk
CMDS=<<EOF
e search.str.min_length=2
/z "et" l ebcdicuk
# Requires increasing the block size because -.-
b 0x1000
# Check string is actually at offset of the hit.
ps ebcdicuk unprintable @ hit.string.ebcdicuk.0
ps ebcdicuk unprintable @ hit.string.ebcdicuk.1
ps ebcdicuk unprintable @ hit.string.ebcdicuk.2
ps ebcdicuk unprintable @ hit.string.ebcdicuk.3
ps ebcdicuk unprintable @ hit.string.ebcdicuk.4
ps ebcdicuk unprintable @ hit.string.ebcdicuk.5
ps ebcdicuk unprintable @ hit.string.ebcdicuk.6
ps ebcdicuk unprintable @ hit.string.ebcdicuk.7
ps ebcdicuk unprintable @ hit.string.ebcdicuk.8
EOF
EXPECT=<<EOF
0x00000018 2 hit.string.ebcdicuk.0
0x00000042 2 hit.string.ebcdicuk.1
0x0000008f 2 hit.string.ebcdicuk.2
0x000000be 2 hit.string.ebcdicuk.3
0x0000010a 2 hit.string.ebcdicuk.4
0x0000012b 2 hit.string.ebcdicuk.5
0x0000013a 2 hit.string.ebcdicuk.6
0x00000152 2 hit.string.ebcdicuk.7
0x00000175 2 hit.string.ebcdicuk.8
et, at eligendi adipisci ius, ex natum appetere officiis has, nibh quas torquatos pro te. Quo at deleniti repudiandae, et oratio pertinacia ullamcorper quo. Per ut stet assum augue, brute pertinacia pri id. Sed omnium oblique placerat ut, eu etiam vitae nam. Per invenire expetenda dissentiet id, ea alia nostrud detraxit est, est eros intellegebat et.
etere officiis has, nibh quas torquatos pro te. Quo at deleniti repudiandae, et oratio pertinacia ullamcorper quo. Per ut stet assum augue, brute pertinacia pri id. Sed omnium oblique placerat ut, eu etiam vitae nam. Per invenire expetenda dissentiet id, ea alia nostrud detraxit est, est eros intellegebat et.
et oratio pertinacia ullamcorper quo. Per ut stet assum augue, brute pertinacia pri id. Sed omnium oblique placerat ut, eu etiam vitae nam. Per invenire expetenda dissentiet id, ea alia nostrud detraxit est, est eros intellegebat et.
et assum augue, brute pertinacia pri id. Sed omnium oblique placerat ut, eu etiam vitae nam. Per invenire expetenda dissentiet id, ea alia nostrud detraxit est, est eros intellegebat et.
etiam vitae nam. Per invenire expetenda dissentiet id, ea alia nostrud detraxit est, est eros intellegebat et.
etenda dissentiet id, ea alia nostrud detraxit est, est eros intellegebat et.
et id, ea alia nostrud detraxit est, est eros intellegebat et.
etraxit est, est eros intellegebat et.
et.
EOF
EXPECT_ERR=
RUN

NAME=String Search - minimal string - Encoding: ebcdic_us - Latin
FILE=bins/cmd/search/string_encodings/Latin-Lipsum.ebcdic_us
CMDS=<<EOF
e search.str.min_length=2
/z "et" l ebcdicus
# Requires increasing the block size because -.-
b 0x1000
# Check string is actually at offset of the hit.
ps ebcdicus unprintable @ hit.string.ebcdicus.0
ps ebcdicus unprintable @ hit.string.ebcdicus.1
ps ebcdicus unprintable @ hit.string.ebcdicus.2
ps ebcdicus unprintable @ hit.string.ebcdicus.3
ps ebcdicus unprintable @ hit.string.ebcdicus.4
ps ebcdicus unprintable @ hit.string.ebcdicus.5
ps ebcdicus unprintable @ hit.string.ebcdicus.6
ps ebcdicus unprintable @ hit.string.ebcdicus.7
ps ebcdicus unprintable @ hit.string.ebcdicus.8
EOF
EXPECT=<<EOF
0x00000018 2 hit.string.ebcdicus.0
0x00000042 2 hit.string.ebcdicus.1
0x0000008f 2 hit.string.ebcdicus.2
0x000000be 2 hit.string.ebcdicus.3
0x0000010a 2 hit.string.ebcdicus.4
0x0000012b 2 hit.string.ebcdicus.5
0x0000013a 2 hit.string.ebcdicus.6
0x00000152 2 hit.string.ebcdicus.7
0x00000175 2 hit.string.ebcdicus.8
et, at eligendi adipisci ius, ex natum appetere officiis has, nibh quas torquatos pro te. Quo at deleniti repudiandae, et oratio pertinacia ullamcorper quo. Per ut stet assum augue, brute pertinacia pri id. Sed omnium oblique placerat ut, eu etiam vitae nam. Per invenire expetenda dissentiet id, ea alia nostrud detraxit est, est eros intellegebat et.
etere officiis has, nibh quas torquatos pro te. Quo at deleniti repudiandae, et oratio pertinacia ullamcorper quo. Per ut stet assum augue, brute pertinacia pri id. Sed omnium oblique placerat ut, eu etiam vitae nam. Per invenire expetenda dissentiet id, ea alia nostrud detraxit est, est eros intellegebat et.
et oratio pertinacia ullamcorper quo. Per ut stet assum augue, brute pertinacia pri id. Sed omnium oblique placerat ut, eu etiam vitae nam. Per invenire expetenda dissentiet id, ea alia nostrud detraxit est, est eros intellegebat et.
et assum augue, brute pertinacia pri id. Sed omnium oblique placerat ut, eu etiam vitae nam. Per invenire expetenda dissentiet id, ea alia nostrud detraxit est, est eros intellegebat et.
etiam vitae nam. Per invenire expetenda dissentiet id, ea alia nostrud detraxit est, est eros intellegebat et.
etenda dissentiet id, ea alia nostrud detraxit est, est eros intellegebat et.
et id, ea alia nostrud detraxit est, est eros intellegebat et.
etraxit est, est eros intellegebat et.
et.
EOF
EXPECT_ERR=
RUN

NAME=String Search - minimal string - Encoding: ebcdic_es - Latin
FILE=bins/cmd/search/string_encodings/Latin-Lipsum.ebcdic_es
CMDS=<<EOF
e search.str.min_length=2
/z "et" l ebcdices
# Requires increasing the block size because -.-
b 0x1000
# Check string is actually at offset of the hit.
ps ebcdices unprintable @ hit.string.ebcdices.0
ps ebcdices unprintable @ hit.string.ebcdices.1
ps ebcdices unprintable @ hit.string.ebcdices.2
ps ebcdices unprintable @ hit.string.ebcdices.3
ps ebcdices unprintable @ hit.string.ebcdices.4
ps ebcdices unprintable @ hit.string.ebcdices.5
ps ebcdices unprintable @ hit.string.ebcdices.6
ps ebcdices unprintable @ hit.string.ebcdices.7
ps ebcdices unprintable @ hit.string.ebcdices.8
EOF
EXPECT=<<EOF
0x00000018 2 hit.string.ebcdices.0
0x00000042 2 hit.string.ebcdices.1
0x0000008f 2 hit.string.ebcdices.2
0x000000be 2 hit.string.ebcdices.3
0x0000010a 2 hit.string.ebcdices.4
0x0000012b 2 hit.string.ebcdices.5
0x0000013a 2 hit.string.ebcdices.6
0x00000152 2 hit.string.ebcdices.7
0x00000175 2 hit.string.ebcdices.8
et, at eligendi adipisci ius, ex natum appetere officiis has, nibh quas torquatos pro te. Quo at deleniti repudiandae, et oratio pertinacia ullamcorper quo. Per ut stet assum augue, brute pertinacia pri id. Sed omnium oblique placerat ut, eu etiam vitae nam. Per invenire expetenda dissentiet id, ea alia nostrud detraxit est, est eros intellegebat et.
etere officiis has, nibh quas torquatos pro te. Quo at deleniti repudiandae, et oratio pertinacia ullamcorper quo. Per ut stet assum augue, brute pertinacia pri id. Sed omnium oblique placerat ut, eu etiam vitae nam. Per invenire expetenda dissentiet id, ea alia nostrud detraxit est, est eros intellegebat et.
et oratio pertinacia ullamcorper quo. Per ut stet assum augue, brute pertinacia pri id. Sed omnium oblique placerat ut, eu etiam vitae nam. Per invenire expetenda dissentiet id, ea alia nostrud detraxit est, est eros intellegebat et.
et assum augue, brute pertinacia pri id. Sed omnium oblique placerat ut, eu etiam vitae nam. Per invenire expetenda dissentiet id, ea alia nostrud detraxit est, est eros intellegebat et.
etiam vitae nam. Per invenire expetenda dissentiet id, ea alia nostrud detraxit est, est eros intellegebat et.
etenda dissentiet id, ea alia nostrud detraxit est, est eros intellegebat et.
et id, ea alia nostrud detraxit est, est eros intellegebat et.
etraxit est, est eros intellegebat et.
et.
EOF
EXPECT_ERR=
RUN

NAME=String search - warn if |search literal| < search.str.min_length
FILE==
ARGS=-1
CMDS=<<EOF
w ab @ 0x10
w abc @ 0x20
w abcd @ 0x30
/z ab
echo ----
/z ab @e:search.str.min_length=2
echo
w ¢€𐍈 @ 0x40
w ¢€𐍈a @ 0x50
/z ¢€𐍈
echo ----
/z ¢€𐍈 @e:search.str.min_length=3
EOF
EXPECT=<<EOF
WARNING: |ab| < search.str.min_length so some search hits may be hidden. Set search.str.min_length to 2 to see them.
0x00000030 2 hit.string.ascii.0
----
0x00000010 2 hit.string.ascii.0
0x00000020 2 hit.string.ascii.1
0x00000030 2 hit.string.ascii.2

WARNING: |¢€𐍈| < search.str.min_length so some search hits may be hidden. Set search.str.min_length to 3 to see them.
0x00000050 9 hit.string.utf8.0
----
0x00000040 9 hit.string.utf8.0
0x00000050 9 hit.string.utf8.1
EOF
RUN
