NAME=e-
FILE==
CMDS=<<EOF
e cfg.seek.histsize
e cfg.seek.histsize=128
e cfg.seek.histsize
e-
e cfg.seek.histsize
EOF
EXPECT=<<EOF
63
128
63
EOF
RUN

NAME=et
FILE==
CMDS=<<EOF
et asm.slow
et asm.bits
et asm.arch
EOF
EXPECT=<<EOF
bool
int
str
EOF
RUN

NAME=e-dot
FILE==
CMDS=e zoom.
EXPECT=<<EOF
zoom.byte=h
zoom.from=0
zoom.in=io.map
zoom.maxsz=512
zoom.to=0
EOF
RUN

NAME=e analysis.gp (mips)
FILE=bins/elf/analysis/mips64r2-cc1
CMDS=e analysis.gp
EXPECT=<<EOF
0x1213a5940
EOF
RUN

NAME=e asm.os
FILE==
CMDS=e asm.os=?
EXPECT=<<EOF
ios
dos
darwin
linux
freebsd
openbsd
netbsd
windows
s110
none
EOF
RUN

NAME=e asm.cpu
FILE==
CMDS=<<EOF
e asm.arch=mips
e asm.cpu=?
EOF
EXPECT=<<EOF
mips32
mips1
mips2
mips32r2
mips32r3
mips32r5
mips32r6
mips3
mips4
mips5
mips64r2
mips64r3
mips64r5
mips64r6
octeon
octeonp
nanomips
nms1
i7200
micromips
micro32r3
micro32r6
r2300
r2600
r2800
r2000a
r2000
r3000a
r3000
r6000
r4000
r4400
r4600
r4700
r5000
rm5000
rm7000
r8000
r9000
r10000
r12000
r14000
r16000
+noptr64
+nofloat
+gpr32
+gpr64
EOF
RUN

NAME=e asm.syntax
FILE==
CMDS=<<EOF
wx eb0e
e asm.arch=x86
e asm.syntax=masm
pi 1
EOF
EXPECT=<<EOF
jmp 10h
EOF
RUN

NAME=multiple assignments
FILE==
CMDS=<<EOF
e scr.highlight=" scr.highlight.grep =scr.utf8 =true"
e scr.highlight
e scr.highlight.grep
e scr.utf8
EOF
EXPECT=<<EOF
 scr.highlight.grep =scr.utf8 =true
false
false
EOF
RUN

NAME=multiple assignments with quotes
FILE==
CMDS=<<EOF
e cmd.prompt='scr.highlight = "e cmd.prompt =  "e scr.highlight = cmd.prompt ="e scr.utf8 = true """'
e cmd.prompt
e scr.highlight
EOF
EXPECT=<<EOF
scr.highlight = "e cmd.prompt =  "e scr.highlight = cmd.prompt ="e scr.utf8 = true """

EOF
RUN

NAME=el commands test
FILE==
CMDS=<<EOF
elj zoom
elJ zoom
el* zoom
ell zoom
elq zoom
EOF
EXPECT=<<EOF
{"zoom.byte":"h","zoom.from":0,"zoom.in":"io.map","zoom.maxsz":512,"zoom.to":0}
[{"name":"zoom.byte","value":"h","type":"str","desc":"Zoom callback to calculate each byte (See pz? for help)","ro":false},{"name":"zoom.from","value":0,"type":"int","desc":"Zoom start address","ro":false},{"name":"zoom.in","value":"io.map","type":"str","desc":"Specify  boundaries for zoom","ro":false,"options":["raw","block","bin.section","bin.sections","bin.sections.rwx","bin.sections.r","bin.sections.rw","bin.sections.rx","bin.sections.wx","bin.sections.x","io.map","io.maps","io.maps.rwx","io.maps.r","io.maps.rw","io.maps.rx","io.maps.wx","io.maps.x","dbg.stack","dbg.heap","dbg.map","dbg.maps","dbg.maps.rwx","dbg.maps.r","dbg.maps.rw","dbg.maps.rx","dbg.maps.wx","dbg.maps.x","analysis.fcn","analysis.bb"]},{"name":"zoom.maxsz","value":512,"type":"int","desc":"Zoom max size of block","ro":false},{"name":"zoom.to","value":0,"type":"int","desc":"Zoom end address","ro":false}]
e zoom.byte=h
e zoom.from=0
e zoom.in=io.map
e zoom.maxsz=512
e zoom.to=0
zoom.byte = h ; Zoom callback to calculate each byte (See pz? for help)
zoom.from = 0 ; Zoom start address
zoom.in = io.map ; Specify  boundaries for zoom [raw, block, bin.section, bin.sections, bin.sections.rwx, bin.sections.r, bin.sections.rw, bin.sections.rx, bin.sections.wx, bin.sections.x, io.map, io.maps, io.maps.rwx, io.maps.r, io.maps.rw, io.maps.rx, io.maps.wx, io.maps.x, dbg.stack, dbg.heap, dbg.map, dbg.maps, dbg.maps.rwx, dbg.maps.r, dbg.maps.rw, dbg.maps.rx, dbg.maps.wx, dbg.maps.x, analysis.fcn, analysis.bb]
zoom.maxsz = 512 ; Zoom max size of block
zoom.to = 0 ; Zoom end address
zoom.byte=h
zoom.from=0
zoom.in=io.map
zoom.maxsz=512
zoom.to=0
EOF
RUN

NAME=List and set plugin configurations
FILE==
CMDS=<<EOF
el plugins
# Should print nothing
el plugins
e asm.arch=hexagon
# Now it should print the hexagon options.
el plugins.
# Check if it only prints a specific sub-category.
el plugins.hexagon.imm
# Check if a value change is performed properly.
wx 01c09da0
pi 1
# Empty buffer
pi 1000~nothing
# Check if option was set
e plugins.hexagon.imm.hash=false
pi 1
# Disable plugin.
e asm.arch=x86
# Should print no hexagon options anymore
el plugins.
EOF
EXPECT=<<EOF
plugins.hexagon.imm.hash=true
plugins.hexagon.imm.sign=true
plugins.hexagon.reg.alias=true
plugins.hexagon.sdk=false
plugins.hexagon.imm.hash: Display ## before 32bit immediates and # before immidiates with other width.
plugins.hexagon.imm.sign: True: Print them with sign. False: Print signed immediates in unsigned representation.
?   allocframe(SP,#0x8):raw
?   allocframe(SP,0x8):raw
EOF
RUN
