Removing preloads from mains tests

Instead of loading all preload for all tests, adding just those functions that are needed for each. Should reduce test times.

Also renaming tests to give some indication of difficulty. Alas they are not run in that order.
This commit is contained in:
2019-09-24 22:05:38 +03:00
parent 1022390e0f
commit 41eccb9382
24 changed files with 153 additions and 44 deletions

View File

@ -0,0 +1,10 @@
class Integer < Data4
def +(right)
X.int_operator(:+)
end
end
class Space
def main(arg)
return 2 + 2
end
end

View File

@ -1,3 +1,8 @@
class Integer < Data4
def -(right)
X.int_operator(:-)
end
end
class Space
def same( n )
return n

View File

@ -1,3 +1,8 @@
class Integer < Data4
def +(right)
X.int_operator(:+)
end
end
class Space
def self.simple
return 2 + 2

View File

@ -1,3 +1,8 @@
class Word < Data8
def putstring
X.putstring
end
end
class Class < Behaviour
def name
@name

View File

@ -1,3 +1,8 @@
class Word < Data8
def putstring
X.putstring
end
end
class Space
def main(arg)
return "Hello-there".putstring

View File

@ -1,3 +1,13 @@
class Integer < Data4
def <(right)
X.comparison(:<)
end
end
class Word < Data8
def putstring
X.putstring
end
end
class Space
def if_small( n )
if( n < 10)

View File

@ -1,3 +1,13 @@
class Integer < Data4
def <(right)
X.comparison(:<)
end
end
class Word < Data8
def putstring
X.putstring
end
end
class Space
def if_small( n )
if( n < 10)

View File

@ -1,3 +1,11 @@
class Integer < Data4
def <(right)
X.comparison(:<)
end
def -(right)
X.int_operator(:-)
end
end
class Space
def down( n )

View File

@ -1,3 +1,11 @@
class Integer < Data4
def <(right)
X.comparison(:<)
end
def +(right)
X.int_operator(:+)
end
end
class Space
def main(arg)
n = 6

View File

@ -0,0 +1,18 @@
class Integer < Data4
def >=(right)
X.comparison(:>=)
end
def -(right)
X.int_operator(:-)
end
end
class Space
def main(arg)
b = 10
while( b >= 1 )
b = b - 1
end
return b
end
end

View File

@ -0,0 +1,22 @@
class Integer < Data4
def <(right)
X.comparison(:<)
end
def +(right)
X.int_operator(:+)
end
def -(right)
X.int_operator(:-)
end
end
class Space
def main(arg)
a = 0
b = 20
while( a < b )
a = a + 1
b = b - 1
end
return a
end
end

View File

@ -1,3 +1,15 @@
class Integer < Data4
def <(right)
X.comparison(:<)
end
def +(right)
X.int_operator(:+)
end
def -(right)
X.int_operator(:-)
end
end
class Space
def fibo_r( n )

View File

@ -1,3 +1,16 @@
class Integer < Data4
def <(right)
X.comparison(:<)
end
def +(right)
X.int_operator(:+)
end
end
class Word < Data8
def putstring
X.putstring
end
end
class Space
def times(n)
i = 0

View File

@ -1,5 +0,0 @@
class Space
def main(arg)
return 2 + 2
end
end

View File

@ -1,11 +0,0 @@
class Space
def main(arg)
a = 0
b = 20
while( a < b )
a = a + 1
b = b - 1
end
return a
end
end

View File

@ -1,9 +0,0 @@
class Space
def main(arg)
b = 10
while( b >= 1 )
b = b - 1
end
return b
end
end