Skip to content

Commit

Permalink
scalafmt
Browse files Browse the repository at this point in the history
  • Loading branch information
badly-drawn-wizards committed Mar 22, 2024
1 parent 4f4232c commit 1161b96
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,20 @@ class ConditionalTests extends RubyCode2CpgFixture {
val cpg = code("""
|f(x ? y : z)
|""".stripMargin)
val List(cond) = cpg.call(Operators.conditional).l
val List(x,y,z) = cond.argument.l
val List(cond) = cpg.call(Operators.conditional).l
val List(x, y, z) = cond.argument.l
x.code shouldBe "x"
List(y,z).isBlock.astChildren.isIdentifier.code.l shouldBe List("y","z")
List(y, z).isBlock.astChildren.isIdentifier.code.l shouldBe List("y", "z")
}

"`f(unless x then y else z end)` is lowered into conditional operator" in {
val cpg = code("""
|f(unless x then y else z end)
|""".stripMargin)
val List(cond) = cpg.call(Operators.conditional).l
val List(x,y,z) = cond.argument.l
val List(cond) = cpg.call(Operators.conditional).l
val List(x, y, z) = cond.argument.l
List(x).isCall.name(Operators.logicalNot).argument.code.l shouldBe List("x")
List(y,z).isBlock.astChildren.isIdentifier.code.l shouldBe List("y","z")
List(y, z).isBlock.astChildren.isIdentifier.code.l shouldBe List("y", "z")
}

}

0 comments on commit 1161b96

Please sign in to comment.