NAME=rz -
FILE=-
CMDS=e file.path
EXPECT=<<EOF

EOF
RUN

NAME=rz -
FILE=-
CMDS=e file.lastpath
EXPECT=<<EOF

EOF
RUN

NAME=rz --
FILE=--
CMDS=e file.path
EXPECT=<<EOF

EOF
RUN

NAME=rz --
FILE=bins/elf/bomb
BROKEN=1
CMDS=rizin -s main -qcs bins/elf/bomb
EXPECT=<<EOF
0x400da0
EOF
RUN

NAME=seek undo/redo
FILE=-
CMDS=<<EOF
wx 01
s 1
sHu
sHr
pb 8
EOF
EXPECT=<<EOF
00000000
EOF
RUN

NAME=seek undo/redo
FILE=-
CMDS=wx 01; s 1; sHu; sHr; pb 8
EXPECT=<<EOF
00000000
EOF
RUN

NAME=rizin -V
FILE=-
CMDS=!!rizin -V~rz_analysis?
EXPECT=<<EOF
1
EOF
RUN

NAME=rizin -h
FILE=-
CMDS=!!rizin -h~Usage?
EXPECT=<<EOF
1
EOF
RUN

NAME=rizin -hh
FILE=-
CMDS=!!rizin -hh~RZ_USER_PLUGINS?
EXPECT=<<EOF
1
EOF
RUN

NAME=rizin -L
FILE=-
CMDS=!!rizin -L~default?
EXPECT=<<EOF
1
EOF
RUN

NAME=rizin shortcut
FILE=-
CMDS=<<EOF
?q `!!rizin -h~Usage?`
?+ ?vi $?
?! ?e `!!rizin.bat -h~Usage?`
EOF
EXPECT=<<EOF
1
EOF
RUN

NAME=no-nl-at-eof script
FILE=-
CMDS=!rizin -i scripts/no-nl-at-eof.rz -NQ -
EXPECT=<<EOF
1
EOF
EXPECT_ERR=<<EOF
EOF
RUN

NAME=rizin -i -Q with missing script
FILE=-
CMDS=<<EOF
# Should not hang
!rizin -i script/missing.rz -NQ -
EOF
EXPECT=<<EOF
EOF
EXPECT_ERR=<<EOF
Script 'script/missing.rz' not found.
EOF
RUN

NAME=rizin empty -i
FILE=-
CMDS=!rizin -i "" -
EXPECT_ERR=<<EOF
Cannot open empty script path
EOF
RUN

NAME=rizin empty -I
FILE=-
CMDS=!rizin -I "" -
EXPECT_ERR=<<EOF
Cannot open empty script path
EOF
RUN

NAME=rizin empty -R
FILE=-
CMDS=!rizin -R ""
EXPECT_ERR=<<EOF
Missing file to open
EOF
RUN

NAME=rizin project with explicit file
FILE=-
CMDS=<<EOF
!rizin -escr.utf8=0 -easm.bytes=1 -escr.color=0 -escr.interactive=0 -N -Qc "f easy @ 0x080483fe; Ps .crackme.rzdb" bins/elf/ioli/crackme0x00
?e Same project, different file
!rizin -escr.utf8=0 -easm.bytes=1 -escr.color=0 -escr.interactive=0 -N -p .crackme.rzdb -Qc "o; pdi 3 @ easy" bins/elf/ioli/crackme0x01
!rm .crackme.rzdb
EOF
EXPECT=<<EOF
Same project, different file
 3 * r-x 0x00001d4b bins/elf/ioli/crackme0x01
 4 - rw- 0x00000004 null://4
0x080483fe   easy:
0x080483fe                 29c4  sub esp, eax
0x08048400       c7042428850408  mov dword [esp], str.IOLI_Crackme_Level_0x01
0x08048407           e810ffffff  call sym.imp.printf
EOF
RUN

NAME=rizin project with implicit file
FILE=-
CMDS=<<EOF
!rizin -escr.utf8=0 -escr.color=0 -escr.interactive=0 -N -Qc "f easy @ 0x080483fe; Ps .crackme2.rzdb" bins/elf/ioli/crackme0x00
?e Reload project including file
!rizin -escr.utf8=0 -escr.color=0 -easm.bytes=1 -escr.interactive=0 -N -p .crackme2.rzdb -Qc "pdi 3 @ easy"
!rm .crackme2.rzdb
EOF
EXPECT=<<EOF
Reload project including file
0x080483fe   easy:
0x080483fe                 08e8  or al, ch
0x08048400                   fc  cld
0x08048401                 7bfb  jnp 0x80483fe
EOF
RUN
