Skip to content

Commit 90d707e

Browse files
committed
fix typo in tests
1 parent 5aac55d commit 90d707e

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

tests/plugins/neg/divideZero-research/plugin_1.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import transform.MegaPhase.MiniPhase
88
import Decorators._
99
import Symbols.Symbol
1010
import Constants.Constant
11+
import StdNames._
1112

1213
class DivideZero extends MiniPhase with Plugin {
1314
val name: String = "divideZero"
@@ -24,9 +25,9 @@ class DivideZero extends MiniPhase with Plugin {
2425

2526
private def isNumericDivide(sym: Symbol)(implicit ctx: Context): Boolean = {
2627
def test(tpe: String): Boolean =
27-
(sym.owner eq ctx.requiredClass(tpe.toTermName)) && sym.name.show == "/"
28+
(sym.owner eq ctx.requiredClass(tpe.toTermName)) && sym.name == nme.DIV
2829

29-
test("scala.Int") || test("scala.Long") || test("scala.Short") || test("scala.FLoat") || test("scala.Double")
30+
test("scala.Int") || test("scala.Long") || test("scala.Short") || test("scala.Float") || test("scala.Double")
3031
}
3132

3233
override def transformApply(tree: tpd.Apply)(implicit ctx: Context): tpd.Tree = tree match {

tests/plugins/neg/divideZero/plugin_1.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import Decorators._
99
import Symbols.Symbol
1010
import Constants.Constant
1111
import transform.{LinkAll, Pickler}
12+
import StdNames._
1213

1314
class DivideZero extends PluginPhase with Plugin {
1415
val name: String = "divideZero"
@@ -23,9 +24,9 @@ class DivideZero extends PluginPhase with Plugin {
2324

2425
private def isNumericDivide(sym: Symbol)(implicit ctx: Context): Boolean = {
2526
def test(tpe: String): Boolean =
26-
(sym.owner eq ctx.requiredClass(tpe.toTermName)) && sym.name.show == "/"
27+
(sym.owner eq ctx.requiredClass(tpe.toTermName)) && sym.name == nme.DIV
2728

28-
test("scala.Int") || test("scala.Long") || test("scala.Short") || test("scala.FLoat") || test("scala.Double")
29+
test("scala.Int") || test("scala.Long") || test("scala.Short") || test("scala.Float") || test("scala.Double")
2930
}
3031

3132
override def transformApply(tree: tpd.Apply)(implicit ctx: Context): tpd.Tree = tree match {

tests/plugins/pos/divideZero/plugin_1.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import transform.MegaPhase.MiniPhase
88
import Decorators._
99
import Symbols.Symbol
1010
import Constants.Constant
11+
import StdNames._
12+
1113

1214
class DivideZero extends MiniPhase with Plugin {
1315
val name: String = "divideZero"
@@ -24,9 +26,9 @@ class DivideZero extends MiniPhase with Plugin {
2426

2527
private def isNumericDivide(sym: Symbol)(implicit ctx: Context): Boolean = {
2628
def test(tpe: String): Boolean =
27-
(sym.owner eq ctx.requiredClass(tpe.toTermName)) && sym.name.show == "/"
29+
(sym.owner eq ctx.requiredClass(tpe.toTermName)) && sym.name == nme.DIV
2830

29-
test("scala.Int") || test("scala.Long") || test("scala.Short") || test("scala.FLoat") || test("scala.Double")
31+
test("scala.Int") || test("scala.Long") || test("scala.Short") || test("scala.Float") || test("scala.Double")
3032
}
3133

3234
override def transformApply(tree: tpd.Apply)(implicit ctx: Context): tpd.Tree = tree match {

0 commit comments

Comments
 (0)