Skip to content

Commit

Permalink
Fix tests in CompletionOverwriteTests
Browse files Browse the repository at this point in the history
The package declaration helps to avoid name clashes.
  • Loading branch information
kiritsuku committed Sep 12, 2014
1 parent 7cd3a39 commit 09f241d
Showing 1 changed file with 20 additions and 0 deletions.
Expand Up @@ -10,6 +10,7 @@ class CompletionOverwriteTests {

@Test
def doNotOverwriteWhenFeatureDisabled() = """
package doNotOverwriteWhenFeatureDisabled
class A {
def foo(i: Int) = 0
def bar(i: Int) = 0
Expand All @@ -18,6 +19,7 @@ class CompletionOverwriteTests {
(new A).b^foo(3)
}
""" becomes """
package doNotOverwriteWhenFeatureDisabled
class A {
def foo(i: Int) = 0
def bar(i: Int) = 0
Expand All @@ -29,13 +31,15 @@ class CompletionOverwriteTests {

@Test
def doNotOverwriteWhenThereIsNothingToBeOverwritten() = """
package doNotOverwriteWhenThereIsNothingToBeOverwritten
class A {
def foo(i: Int) = 0
}
object X {
(new A).fo^
}
""" becomes """
package doNotOverwriteWhenThereIsNothingToBeOverwritten
class A {
def foo(i: Int) = 0
}
Expand All @@ -46,6 +50,7 @@ class CompletionOverwriteTests {

@Test
def overwriteBeforeParamList() = """
package overwriteBeforeParamList
class A {
def foo(i: Int) = 0
def bar(i: Int) = 0
Expand All @@ -54,6 +59,7 @@ class CompletionOverwriteTests {
(new A).b^foo(3)
}
""" becomes """
package overwriteBeforeParamList
class A {
def foo(i: Int) = 0
def bar(i: Int) = 0
Expand All @@ -65,13 +71,15 @@ class CompletionOverwriteTests {

@Test
def overwriteInsideOfParamList() = """
package overwriteInsideOfParamList
object X {
def meth = 0
val value = 0
println(me^value)
}
""" becomes """
package overwriteInsideOfParamList
object X {
def meth = 0
val value = 0
Expand All @@ -82,11 +90,13 @@ class CompletionOverwriteTests {

@Test
def overwriteBeforeInfixMethodCall() = """
package overwriteBeforeInfixMethodCall
object X {
val ident1, ident2 = true
val x = ide^nt1 && ident1
}
""" becomes """
package overwriteBeforeInfixMethodCall
object X {
val ident1, ident2 = true
val x = ident2^ && ident1
Expand All @@ -95,11 +105,13 @@ class CompletionOverwriteTests {

@Test
def overwriteBeforeMethodCallWithPunctuation() = """
package overwriteBeforeMethodCallWithPunctuation
object X {
val ident1, ident2 = true
val x = ide^nt1.&&(ident1)
}
""" becomes """
package overwriteBeforeMethodCallWithPunctuation
object X {
val ident1, ident2 = true
val x = ident2^.&&(ident1)
Expand All @@ -108,6 +120,7 @@ class CompletionOverwriteTests {

@Test @Ignore("unimplemented, see #1002092")
def overwriteBeforeParamListWhenNoParensExist() = """
package overwriteBeforeParamListWhenNoParensExist
class A {
def meth(arg: Int) = arg
def func(arg: Int) = arg
Expand All @@ -118,6 +131,7 @@ class CompletionOverwriteTests {
obj fu^meth arg
}
""" becomes """
package overwriteBeforeParamListWhenNoParensExist
class A {
def meth(arg: Int) = arg
def func(arg: Int) = arg
Expand All @@ -131,11 +145,13 @@ class CompletionOverwriteTests {

@Test
def overwriteBeforeEndOfLine() = """
package overwriteBeforeEndOfLine
object X {
val ident1, ident2 = 0
val x = iden^t1
}
""" becomes """
package overwriteBeforeEndOfLine
object X {
val ident1, ident2 = 0
val x = ident2^
Expand All @@ -144,11 +160,13 @@ class CompletionOverwriteTests {

@Test
def overwriteBeforeComment() = """
package overwriteBeforeComment
object X {
val ident1, ident2 = 0
val x = iden^t1 // comment
}
""" becomes """
package overwriteBeforeComment
object X {
val ident1, ident2 = 0
val x = ident2^ // comment
Expand All @@ -157,12 +175,14 @@ class CompletionOverwriteTests {

@Test @Ignore("unimplemented, see #1002093")
def overwriteBeforeUnderscore() = """
package overwriteBeforeUnderscore
object X {
def func(i: Int) = i
def meth(i: Int) = i
val x = me^func _
}
""" becomes """
package overwriteBeforeUnderscore
object X {
def func(i: Int) = i
def meth(i: Int) = i
Expand Down

0 comments on commit 09f241d

Please sign in to comment.