Refactor REPL tests: use empty line instead of "null"

This commit is contained in:
Alexander Udalov
2014-07-27 21:17:40 +02:00
parent 44246349a5
commit c6dfa866cd
12 changed files with 1 additions and 17 deletions
@@ -1,5 +1,4 @@
>>> fun foo() = 765 >>> fun foo() = 765
null
>>> foo(1) >>> foo(1)
ERROR: /line2.kts: (1, 5) Too many arguments for internal final fun foo(): kotlin.Int defined in <script> ERROR: /line2.kts: (1, 5) Too many arguments for internal final fun foo(): kotlin.Int defined in <script>
>>> foo() >>> foo()
-2
View File
@@ -1,8 +1,6 @@
>>> >>>
null
>>> 101 >>> 101
101 101
>>> >>>
null
>>> 102 >>> 102
102 102
@@ -1,6 +1,5 @@
>>> throw Exception("hi there") >>> throw Exception("hi there")
substring: Exception: hi there substring: Exception: hi there
>>> fun foo() = 2 >>> fun foo() = 2
null
>>> foo() >>> foo()
2 2
-1
View File
@@ -1,4 +1,3 @@
>>> fun foo() = 2 >>> fun foo() = 2
null
>>> foo() >>> foo()
2 2
@@ -1,6 +1,4 @@
>>> fun foo() = 10 >>> fun foo() = 10
null
>>> fun foo() = 11 >>> fun foo() = 11
null
>>> foo() >>> foo()
11 11
@@ -1,6 +1,4 @@
>>> fun foo(s: String) = "string" >>> fun foo(s: String) = "string"
null
>>> fun foo(a: Any) = "any" >>> fun foo(a: Any) = "any"
null
>>> foo("a") >>> foo("a")
any any
@@ -1,6 +1,4 @@
>>> val x = 1 >>> val x = 1
null
>>> fun add1(y: Int) = x + y >>> fun add1(y: Int) = x + y
null
>>> add1(999999) >>> add1(999999)
1000000 1000000
-2
View File
@@ -1,6 +1,4 @@
>>> import java.io.ByteArrayOutputStream >>> import java.io.ByteArrayOutputStream
null
>>> val s = ByteArrayOutputStream() >>> val s = ByteArrayOutputStream()
null
>>> s.javaClass!!.getName() >>> s.javaClass!!.getName()
java.io.ByteArrayOutputStream java.io.ByteArrayOutputStream
-1
View File
@@ -1,6 +1,5 @@
>>> fun clock() = >>> fun clock() =
incomplete incomplete
>>> 12 >>> 12
null
>>> clock() >>> clock()
12 12
-1
View File
@@ -5,6 +5,5 @@ incomplete
>>> 2 + >>> 2 +
incomplete incomplete
>>> 1 >>> 1
null
>>> get7() >>> get7()
7 7
-1
View File
@@ -2,6 +2,5 @@
ERROR: /line1.kts: (1, 1) Expecting an element ERROR: /line1.kts: (1, 1) Expecting an element
ERROR: /line1.kts: (1, 3) Expecting an expression ERROR: /line1.kts: (1, 3) Expecting an expression
>>> fun foo() = 98 >>> fun foo() = 98
null
>>> foo() >>> foo()
98 98
@@ -116,7 +116,7 @@ public abstract class AbstractReplInterpreterTest extends UsefulTestCase {
else { else {
actual = lineResult.getErrorText(); actual = lineResult.getErrorText();
} }
String actualString = StringUtil.convertLineSeparators(actual != null ? actual.toString() : "null").replaceFirst("\n$", ""); String actualString = StringUtil.convertLineSeparators(actual != null ? actual.toString() : "").replaceFirst("\n$", "");
if (line.matchType == MatchType.EQUALS) { if (line.matchType == MatchType.EQUALS) {
Assert.assertEquals("after evaluation of: " + line.code, expected, actualString); Assert.assertEquals("after evaluation of: " + line.code, expected, actualString);