NAME=Internal less
FILE==
CMDS=<<EOF
e scr.interactive=false
pd 1~..
EOF
EXPECT_ERR=<<EOF
Internal less requires scr.interactive=true.
EOF
RUN

NAME=Hud mode
FILE==
CMDS=<<EOF
e scr.interactive=false
pd 1~...
EOF
EXPECT_ERR=<<EOF
Hud mode requires scr.interactive=true.
EOF
RUN

NAME=?** search
FILE==
CMDS=<<EOF
e scr.interactive=true
e scr.utf8=true
e scr.columns=120
e scr.rows=4
e scr.color=0
< \n; ?**
echo
echo
e scr.utf8=false
< \n; ?**
echo
EOF
EXPECT=<<EOF
[?25l[0m[2J
[0;0H0> |                                                                                                                   [0m[2J
[0;0H0> |
 - │ !<command> [<args1> <args2> ...] # Run command via system(3) with raw output. Grepping via '~' automatically forces
                                        use of '!!' instead.                                                            
   │ !!<command> [<args1> <args2> ...] # Run command via system(3) and pipe its stdout to rizin                         [?25h

[?25l[0m[2J
[0;0H0> |                                                                                                                   [0m[2J
[0;0H0> |
 - | !<command> [<args1> <args2> ...] # Run command via system(3) with raw output. Grepping via '~' automatically forces
                                        use of '!!' instead.                                                            
   | !!<command> [<args1> <args2> ...] # Run command via system(3) and pipe its stdout to rizin                         [?25h
EOF
RUN

NAME=?** entire help string on match
FILE=--
CMDS=<<EOF
e scr.interactive=true
e scr.utf8=true
e scr.columns=100
e scr.rows=3
e scr.color=0
< f\n; ?**
echo
EOF
EXPECT=<<EOF
[?25l[0m[2J
[0;0H0> |                                                                                               [0m[2J
[0;0H0> |
 - │ !<command> [<args1> <args2> ...] # Run command via system(3) with raw output. Grepping via '~' 
                                        automatically forces use of '!!' instead.                   [0;0H0> f|                                                                                               [0;0H0> f|
 - │ !<command> [<args1> <args2> ...] # Run command via system(3) with raw output. Grepping via '~' 
                                        automatically Forces use oF '!!' instead.                   [?25h
EOF
RUN

NAME=?** wrapping
FILE=--
CMDS=<<EOF
e scr.interactive=true
e scr.utf8=true
e scr.columns=100
e scr.rows=5
e scr.color=0
< q\n; ?**
echo
EOF
EXPECT=<<EOF
[?25l[0m[2J
[0;0H0> |                                                                                               [0m[2J
[0;0H0> |
 - │ !<command> [<args1> <args2> ...] # Run command via system(3) with raw output. Grepping via '~' 
                                        automatically forces use of '!!' instead.                   
   │ !!<command> [<args1> <args2> ...] # Run command via system(3) and pipe its stdout to rizin     
   │ #!<interpreter-name> [<arg1> <arg2> ...] # Run interpreter                                     [0;0H0> q|                                                                                               [0;0H0> q|
 - │ %l <str>             # Calculate length of string <str>. Quiet mode stores value in `$?`       
                            register.                                                               
   │ %lQ <str>            # Calculate length of string <str>. Quiet mode stores value in `$?`       
                            register. (Quiet mode)                                                  [?25h
EOF
RUN

NAME=?**e search
FILE==
CMDS=<<EOF
e scr.interactive=true
e scr.utf8=true
e scr.columns=120
e scr.rows=3
e scr.color=0
< \n; ?**e
echo
EOF
EXPECT=<<EOF
[?25l[0m[2J
[0;0H0> |                                                                                                                   [0m[2J
[0;0H0> |
 - analysis.apply.signature:       bool - enables/disables auto-applying signatures to the loaded binary (see also flirt[0J
[0m
          analysis.arch: string,bind - Select the architecture to use                                                   [?25h
EOF
RUN

NAME=?*** search
FILE==
CMDS=<<EOF
e scr.interactive=true
e scr.utf8=true
e scr.columns=100
e scr.rows=6
e scr.color=0
< %l\n; ?***
echo
EOF
EXPECT=<<EOF
[?25l[0m[2J
[0;0H0> |                                                                                               [0m[2J
[0;0H0> |
 - ! | Usage: !<command> [<args1> <args2> ...]   # Run command via system(3) with raw output.       
   ! |                                             Grepping via '~' automatically forces use of '!!'
   ! |                                             instead.                                         
   ! | Examples:                                                                                    
   ! | | !ls                     # Execute the 'ls' command via system(3)                           [0;0H0> %|                                                                                               [0;0H0> %|
 - $ | Usage: $[alias[=cmd] [args...]]   # List all defined aliases / Define alias (see %$? for help
   % | Usage: %[j] <expr>   # Evaluate numerical expression <expr>                                  
   % | │ % <expr>     # Evaluate numerical expression <expr>                                        
   % | │ %j <expr>    # Evaluate numerical expression <expr> (JSON mode)                            
   %j | Usage: %j[j] <expr>   # Evaluate numerical expression <expr> (JSON mode)                    [0;0H0> %l|                                                                                              [0;0H0> %l|
 - %L | Usage: %L[q] <str>   # Calculate length of string <str>. Quiet mode stores value in `$?`    
   %L |                        register.                                                            
   %L | │ %L <str>     # Calculate length of string <str>. Quiet mode stores value in `$?` register.
   %L | │ %Lq <str>    # Calculate length of string <str>. Quiet mode stores value in `$?` register.
   %L |                  (quiet mode)                                                               [?25h
EOF
RUN

NAME=p==v visual histogram interactive (#4431 regression)
FILE=malloc://512
CMDS=<<EOF
e scr.interactive=true
e scr.utf8=true
e scr.columns=80
e scr.rows=12
e scr.color=0
e scr.hist.minimap=true
wx 00112233445566778899aabbccddeeff @ 0
< lq; p==v
echo END
EOF
EXPECT=<<EOF
[?25l     ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
                                                                               
 255│▼                                                                          
 213│█                                                                          
    │█                                                                          
 128│█                                                                          
  85│█                                                                          
    │█                                                                          
   0│▲██████████████████████████████████████████████████████████████████████████
     ^        ^        ^        ^         ^        ^        ^        ^         ^
     0x0      0x0      0x0      0x0       0x0      0x100    0x100    0x100     0
Index 0 data 0                                                         0x0    0%[?25l[0m[2J
[0;0H     ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━[0J
[0m
                                                                               
 255│                                     ▼                                     
 213│                                     █                                     
    │                                     █                                     
 128│                                     █                                     
  85│                                     █                                     
    │                                     █                                     
   0│█████████████████████████████████████▲█████████████████████████████████████
     ^        ^        ^        ^         ^        ^        ^        ^         ^
     0x0      0x0      0x0      0x0       0x0      0x100    0x100    0x100     0
Index 1 data 0                                                       0x100  100%[?25h[0m[2J
[0;0HEND
EOF
RUN

NAME=data xrefs outside functions marked as data
FILE=bins/elf/analysis/mipsbe-ip
CMDS=<<EOF
e scr.utf8=false
e scr.color=0
aaa
s 0x4350f8
< q ; Vp
echo END
EOF
EXPECT=<<EOF
[?25l[0;0H[0m[0x004350f8 [xAdvc]0 90% 115 bins/elf/analysis/mipsbe-ip]> pd $r @ data.004350f8
            ; XREFS(69)                                                         
            ;-- data.004350f8:                                                  
            0x004350f8      .dword 0x00430000                                   
            ; DATA XREF from fcn.004020d0 @ 0x402108                            
            ;-- data.004350fc:                                                  
            0x004350fc      .dword 0x00435420 ; section..sdata                  
            ; DATA XREF from fcn.004020d0 @ 0x402120                            
            ;-- data.00435100:                                                  
            0x00435100      .dword 0x0043396c ; obj.__DTOR_END                  
            ; XREFS(156)                                                        
            ;-- data.00435104:                                                  
            0x00435104      .dword 0x00420000 ; str.ute_get_ADDRESS___from_ADDRE[0J
[0m
            ; DATA XREF from sym._init @ 0x402024                               
            ; DATA XREF from sym._fini @ 0x41ecd0                               
            ;-- data.00435108:                                                  
            0x00435108      .dword 0x00400000 ; segment.LOAD0 ; segment.ehdr    
            0x0043510c      .dword 0x00000000                                   
            0x00435110      .dword 0x00000000                                   
            0x00435114      .dword 0x00000000                                   
            0x00435118      .dword 0x00000000                                   
            ; DATA XREF from fcn.00414700 @ +0xbb0                              
            ; DATA XREF from sym.rtnl_open_byproto @ 0x41a878                   [23;75H0.0%[?25h[0m[2J
[0;0HEND
EOF
RUN
