Skip to content
Snippets Groups Projects
Commit 8c91bcc4 authored by Etienne Kneuss's avatar Etienne Kneuss
Browse files

Remove unused ad-hoc test files

parent a3cab185
Branches
Tags
No related merge requests found
object NestedVar {
def foo(): Int = {
val a = 3
def rec(x: Int): Int = {
var b = 3
var c = 3
if(x > 0)
b = 2
else
c = 2
c+b
}
rec(a)
} ensuring(_ == 5)
}
object Unit1 {
def foo(): Unit = ({
()
}) ensuring(_ == ())
}
object Unit2 {
def foo(u: Unit): Unit = {
u
} ensuring(_ == ())
}
object While1 {
def foo(): Int = {
var a = 0
var i = 0
while(i < 10) {
a = a + 1
i = i + 1
}
a
} ensuring(_ == 10)
}
object While1 {
def foo(): Int = {
var a = 0
var i = 0
while(i < 10) {
a = a + i
i = i + 1
}
a
} ensuring(_ == 45)
}
object While3 {
def foo(): Int = {
var a = 0
var i = 0
while({i = i+2; i <= 10}) {
a = a + i
i = i - 1
}
a
} ensuring(_ == 54)
}
#!/bin/bash
base=./regression
nbtests=$(ls -l $base/{valid,invalid,error}/*.scala | wc -l)
nbsuccess=0
failedtests=""
for f in $base/valid/*.scala; do
echo -n "Running $f, expecting VALID, got: "
res=`./leon --xlang --noLuckyTests --timeout=10 --oneline "$f"`
echo $res | tr [a-z] [A-Z]
if [ $res = valid ]; then
nbsuccess=$((nbsuccess + 1))
else
failedtests="$failedtests $f"
fi
done
for f in $base/invalid/*.scala; do
echo -n "Running $f, expecting INVALID, got: "
res=`./leon --xlang --noLuckyTests --timeout=10 --oneline "$f"`
echo $res | tr [a-z] [A-Z]
if [ $res = invalid ]; then
nbsuccess=$((nbsuccess + 1))
else
failedtests="$failedtests $f"
fi
done
for f in $base/error/*.scala; do
echo -n "Running $f, expecting ERROR, got: "
res=`./leon --xlang --noLuckyTests --timeout=10 --oneline "$f"`
echo $res | tr [a-z] [A-Z]
if [ $res = error ]; then
nbsuccess=$((nbsuccess + 1))
else
failedtests="$failedtests $f"
fi
done
echo "$nbsuccess out of $nbtests tests were successful"
if [ $nbtests -eq $nbsuccess ]; then
echo "PASSED"
else
echo "ERROR. The following test did not run as expected:"
for f in $failedtests; do echo $f; done
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment