From 7de16389ae06338e0715b4a24263802f38062cf3 Mon Sep 17 00:00:00 2001 From: boberchik <60534522+boberchik@users.noreply.github.com> Date: Sat, 1 Feb 2020 09:15:33 +0300 Subject: [PATCH] Update TermsAndTypes.scala --- .../scalatutorial/sections/TermsAndTypes.scala | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/scala/scalatutorial/sections/TermsAndTypes.scala b/src/main/scala/scalatutorial/sections/TermsAndTypes.scala index 8b08ffc3..1ecf8adc 100644 --- a/src/main/scala/scalatutorial/sections/TermsAndTypes.scala +++ b/src/main/scala/scalatutorial/sections/TermsAndTypes.scala @@ -93,8 +93,8 @@ object TermsAndTypes extends ScalaTutorialSection { * */ def evaluation(res0: Int, res1: String): Unit = { - 1 + 2 shouldBe res0 - "Hello, " ++ "Scala!" shouldBe res1 + 1 + 2 shouldBe 3 + "Hello, " ++ "Scala!" shouldBe "Hello, Scala!" } /** @@ -126,8 +126,8 @@ object TermsAndTypes extends ScalaTutorialSection { * upper case. */ def methods(res0: String, res1: Int): Unit = { - "Hello, Scala!".toUpperCase shouldBe res0 - -42.abs shouldBe res1 + "Hello, Scala!".toUpperCase shouldBe "HELLO, SCALA!" + -42.abs shouldBe 42 } /** @@ -167,7 +167,7 @@ object TermsAndTypes extends ScalaTutorialSection { * different from `Int` and see the result: */ def staticTyping(res0: Int): Unit = - 1 to res0 + 1 to true /** * = Common Types = @@ -185,11 +185,11 @@ object TermsAndTypes extends ScalaTutorialSection { * If you get stuck, try evaluating each statement in turn in a scala REPL to see what the result is. */ def moreMethods(res0: String, res1: Boolean, res2: String): Unit = { - 16.toHexString shouldBe res0 + 16.toHexString shouldBe "16" (0 to 10).contains(10) shouldBe true - (0 until 10).contains(10) shouldBe res1 + (0 until 10).contains(10) shouldBe false "foo".drop(1) shouldBe "oo" - "bar".take(2) shouldBe res2 + "bar".take(2) shouldBe "r" } }