Skip to content
Snippets Groups Projects
Commit 869ea546 authored by Régis Blanc's avatar Régis Blanc
Browse files

some more tests

parent 7a8cfc64
No related branches found
No related tags found
No related merge requests found
...@@ -4,15 +4,9 @@ object Assign1 { ...@@ -4,15 +4,9 @@ object Assign1 {
var a = 0 var a = 0
val tmp = a + 1 val tmp = a + 1
a = a + 2 a = a + 2
a = a + 3 a = a + tmp
a = a + 4 a = a + 4
//var j = 0
//var sortedArray = Map.empty[Int, Int]
//val tmp = sortedArray(j)
//sortedArray = sortedArray.updated(j, sortedArray(j+1))
//sortedArray = sortedArray.updated(j+1, tmp)
//sortedArray(j)
a a
} } ensuring(_ == 7)
} }
object MyTuple4 { object MyTuple3 {
def foo(): Int = { def foo(): Int = {
val t = ((2, 3), true) val t = ((2, 3), true)
...@@ -6,5 +6,3 @@ object MyTuple4 { ...@@ -6,5 +6,3 @@ object MyTuple4 {
} ensuring( _ == 3) } ensuring( _ == 3)
} }
// vim: set ts=4 sw=4 et:
object Nested2 { object Nested1 {
def foo(i: Int): Int = { def foo(i: Int): Int = {
val n = 2 val n = 2
......
...@@ -4,10 +4,10 @@ object While1 { ...@@ -4,10 +4,10 @@ object While1 {
var a = 0 var a = 0
var i = 0 var i = 0
while(i < 10) { while(i < 10) {
a = a + i a = a + 1
i = i + 1 i = i + 1
} }
a 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 While1 { object While3 {
def foo(): Int = { def foo(): Int = {
var a = 0 var a = 0
...@@ -11,5 +11,3 @@ object While1 { ...@@ -11,5 +11,3 @@ object While1 {
} ensuring(_ == 54) } ensuring(_ == 54)
} }
// vim: set ts=4 sw=4 et:
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment