#!./tt++ -G

#format start %U

#math error 0

#alias error
{
    #math error $error + 1;
    #line ignore #showme <118>Failed test %0
}

#nop ----------

#math tmp 1 + 1

#if {$tmp != 2}
{
    error 1: math failure
}

#nop ----------

#alias {test} {#math tmp $tmp + 1}
#line oneshot #alias {test%*} {#nop} {4}
#math tmp 0
#2 test
#if {$tmp != 1}
{
    error 2: oneshot or math or alias failure
}

#nop ----------

#1 {#return;error 3: #return failure}

#nop ----------

#buf get tmp -3 -1

#if {&tmp[] != 2}
{
    error 4: buffer or variable or if failure ($tmp)
}

#nop ----------

#switch {3} {#case 3 #return;#default error 5: switch failure}

#nop ----------

#class tmp open
#unvar tmp
#var tmp 1
#class tmp kill

#if {&{tmp} != 0}
{
    error 6: class or variable failure
}

#nop ----------

#loop 1 2 tmp {#continue;error 7: continue failure}

#nop ----------

#kill variable tmp

#if {&{tmp} != 0}
{
    error 8: kill variable %* failure
}

#line strip #if {{<128>} != {}}
{
    error 9: line strip failure
}

#nop ----------

#act {test} {error 10: line ignore failure}
#line gag;
#line ignore #showme <118>Failed test 10: line gag failure
#unact {test}

#nop ----------

#parse {abcd} {tmp} {#var tmp ($tmp)}
#if {"$tmp" != "(d)"}
{
    error 11: parse failure
}

#nop ----------

#path load {#var tmp 1}
#path walk
#if {$tmp != 1}
{
    error 12: path load or walk failure
}

#nop ----------

#script tmp {echo 'test'}
#if {{$tmp[1]} != {test}}
{
    error 13: script failure
}

#nop ----------

#regex {test} {te%?t} {#nop}
{
    error 14: regex failure
}

#nop ----------

#regex {bla} {bli}
{
    error 15: regex failure
}

#nop ----------

#0 error 16: repeat failure

#nop ----------

#unvar tmp

#1
{
    #local tmp 1;
    #if {$tmp != 1}
    {
        error 17: local failure
    }
}

#nop ----------

#if {$tmp == 1}
{
	error 18: local failure
}

#nop ----------

#1
{
    #local tmp 2;

    #regex {a} {a}
    {
        #if {$tmp != 2}
        {
            error 19: local failure
        }
    }
}

#nop ----------

#if {"$arglebargle" != "\$arglebargle"}
{
	error 20: unassigned variable
}

#nop ----------

#alias {bla} {error 21: unalias malfunction}
#alias {bla%*} {#nop}
#unalias {bla}
bla
#unalias {bla%*}

#nop ----------

#class bla open
#var bla 2
#var bli 2
#alias haha hihi
#fun bla blo
#class bla close
#class bla save
#class bla clear
#if {&{bla} != 0} {error 22: #class clear malfunction}
#class bla load
#if {&{bla} == 0} {error 23: #class load malfunction}
#class bla kill


#nop ----------

#if {(513 & ~1) != 512} {error 24.01: #math error}
#if {1 << 1 != 2}       {error 24.02: #math error}

#nop ----------

#action {bla} #nop
#unact bla
#alias {bla} #nop
#unalias bla
#bell volume 8
#buffer get bla -1 -1;
#button {1;1;2;2} {#nop}
#unbutton {1;1;2;2}
#cat bla bli
#line quiet #chat init 0
#chat uninit
#class bla open
#class bla kill
#cursor get bla
#line quiet #daemon list
#line quiet {#debug all on;#debug all off};
#line quiet #dictionary bla
#line quiet #dictionary hello
#draw green tile 1 -1 1 -1
#event {GAG SESSION DISCONNECTED} {#nop}
#format bla {}
#fun bla {#nop}
#unfun bla
#line quiet #help %*
#high bla green
#unhigh bla
#history insert bla
#history delete
#info system save
#list bla create {a;b;c}
#kill variable bla
#loop 0 1 bla #nop
#macro \e\e #nop
#unmacro \e\e
#line quiet #map create
#line quiet #map destroy world
#math bla 2+2
#message all on
#parse {abc} {bla} {#nop}
#path create
#path destroy
#pathdir bla bli
#unpathdir bla
#line quiet #port init bla 0
#all #nop
#line quiet #port uninit
#prompt bla bli
#unprompt bla
#regex {bla} {bla} {#nop} {#nop}
#var bla x
#replace bla x y
#screen get cols bla
#snoop bla
#line quiet #split
#unsplit
#sub bla bli
#unsub bla
#tab bla bli
#untab bla
#tick bla {#nop} 1
#untick bla

#format end %U;

#nop ----------

#function time
{
	#math result ($end - $start) / 1000000.000
}

#if {$error}
{
    #end <118>End of validation with $error errors.<088>
}
{
    #end <128>End of validation with 0 errors in @time{} seconds.<088>
}
