Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
7
Task/Assertions/Phix/assertions-1.phix
Normal file
7
Task/Assertions/Phix/assertions-1.phix
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
type int42(object i)
|
||||
return i=42
|
||||
end type
|
||||
|
||||
int42 i
|
||||
|
||||
i = 41 -- type-check failure
|
||||
13
Task/Assertions/Phix/assertions-2.phix
Normal file
13
Task/Assertions/Phix/assertions-2.phix
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
global constant DEBUG = 0 -- (or any other identifier name can be used)
|
||||
global procedure assert(integer flag, string msg)
|
||||
if DEBUG then
|
||||
if not flag then
|
||||
{} = message_box(msg,"failed assertion",MB_OK) -- or
|
||||
puts(1,msg) -- , and/or
|
||||
crash(msg) -- crash/ex.err report -- or
|
||||
trace(1) -- start debugging
|
||||
end if
|
||||
end if
|
||||
end function
|
||||
|
||||
assert(i=42,"i is not 42!!")
|
||||
2
Task/Assertions/Phix/assertions-3.phix
Normal file
2
Task/Assertions/Phix/assertions-3.phix
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
if i!=42 then ?9/0 end if
|
||||
if i!=42 then crash("i is not 42!!") end if
|
||||
Loading…
Add table
Add a link
Reference in a new issue