Skip to content

Commit

Permalink
Merge pull request #14 from cjudd/maptuple
Browse files Browse the repository at this point in the history
  • Loading branch information
bsamaripa authored Jan 2, 2024
2 parents 242515e + b977fe3 commit 019528c
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 33 deletions.
9 changes: 0 additions & 9 deletions src/test/scala/org/scalakoans/AboutMaps.scala
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,6 @@ class AboutMaps extends KoanSuite {
aNewMap.size should be(__)
}

koan("Map elements can be removed with a tuple") {
val myMap = Map("MI" -> "Michigan", "OH" -> "Ohio", "WI" -> "Wisconsin", "IA" -> "Iowa")
val aNewMap = myMap -- List("MI", "WI") // Notice: single '-' operator for tuples

aNewMap.contains("MI") should be(__)
aNewMap.contains("OH") should be(__)
aNewMap.size should be(__)
}

koan("Attempted removal of nonexistent elements from a map is handled gracefully") {
val myMap = Map("MI" -> "Michigan", "OH" -> "Ohio", "WI" -> "Wisconsin", "IA" -> "Iowa")
val aNewMap = myMap - "MN"
Expand Down
14 changes: 0 additions & 14 deletions src/test/scala/org/scalakoans/AboutMutableSets.scala
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,6 @@ class AboutMutableSets extends KoanSuite {
mySet contains "Ohio" should be(__)
}

koan("Mutable sets can have tuples of elements removed") {
val mySet = mutable.Set("Michigan", "Ohio", "Wisconsin", "Iowa")
mySet --= List("Iowa", "Ohio")
mySet contains "Ohio" should be(__)
mySet.size should be(__)
}

koan("Mutable sets can have tuples of elements added") {
val mySet = mutable.Set("Michigan", "Wisconsin")
mySet ++= List("Iowa", "Ohio")
mySet contains "Ohio" should be(__)
mySet.size should be(__)
}

koan("Mutable sets can have Lists of elements added") {
val mySet = mutable.Set("Michigan", "Wisconsin")
mySet ++= List("Iowa", "Ohio")
Expand Down
10 changes: 0 additions & 10 deletions src/test/scala/org/scalakoans/AboutSets.scala
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,6 @@ class AboutSets extends KoanSuite {
aNewSet.size should be(__)
}

koan("Set elements can be removed with a tuple") {
val mySet = Set("Michigan", "Ohio", "Wisconsin", "Iowa")
val aNewSet = mySet.removedAll(Set("Michigan", "Ohio"))

aNewSet.contains("Michigan") should be(__)
aNewSet.contains("Wisconsin") should be(__)
aNewSet.size should be(__)
}
koan("Attempted removal of nonexistent elements from a set is handled gracefully") {
val mySet = Set("Michigan", "Ohio", "Wisconsin", "Iowa")
val aNewSet = mySet - "Minnesota"
Expand Down Expand Up @@ -125,6 +117,4 @@ class AboutSets extends KoanSuite {
mySet1.equals(mySet2) should be(__)
}



}

0 comments on commit 019528c

Please sign in to comment.