@@ -56,56 +56,56 @@ class NonEmptySetSuite extends CatsSuite {
5656 forAll { (i : Int , tail : SortedSet [Int ]) =>
5757 val set = tail + i
5858 val nonEmptySet = NonEmptySet (i, tail)
59- set should === (nonEmptySet.toSet )
59+ set should === (nonEmptySet.toSortedSet )
6060 }
6161 }
6262
6363 test(" NonEmptySet#filter is consistent with Set#filter" ) {
6464 forAll { (nes : NonEmptySet [Int ], p : Int => Boolean ) =>
65- val set = nes.toSet
65+ val set = nes.toSortedSet
6666 nes.filter(p) should === (set.filter(p))
6767 }
6868 }
6969
7070 test(" NonEmptySet#filterNot is consistent with Set#filterNot" ) {
7171 forAll { (nes : NonEmptySet [Int ], p : Int => Boolean ) =>
72- val set = nes.toSet
72+ val set = nes.toSortedSet
7373 nes.filterNot(p) should === (set.filterNot(p))
7474 }
7575 }
7676
7777 test(" NonEmptySet#collect is consistent with Set#collect" ) {
7878 forAll { (nes : NonEmptySet [Int ], pf : PartialFunction [Int , String ]) =>
79- val set = nes.toSet
79+ val set = nes.toSortedSet
8080 nes.collect(pf) should === (set.collect(pf))
8181 }
8282 }
8383
8484 test(" NonEmptySet#find is consistent with Set#find" ) {
8585 forAll { (nes : NonEmptySet [Int ], p : Int => Boolean ) =>
86- val set = nes.toSet
86+ val set = nes.toSortedSet
8787 nes.find(p) should === (set.find(p))
8888 }
8989 }
9090
9191 test(" NonEmptySet#exists is consistent with Set#exists" ) {
9292 forAll { (nes : NonEmptySet [Int ], p : Int => Boolean ) =>
93- val set = nes.toSet
93+ val set = nes.toSortedSet
9494 nes.exists(p) should === (set.exists(p))
9595 }
9696 }
9797
9898 test(" NonEmptySet#forall is consistent with Set#forall" ) {
9999 forAll { (nes : NonEmptySet [Int ], p : Int => Boolean ) =>
100- val set = nes.toSet
100+ val set = nes.toSortedSet
101101 nes.forall(p) should === (set.forall(p))
102102 }
103103 }
104104
105105 test(" NonEmptySet#map is consistent with Set#map" ) {
106106 forAll { (nes : NonEmptySet [Int ], p : Int => String ) =>
107- val set = nes.toSet
108- nes.map(p).toSet should === (set.map(p))
107+ val set = nes.toSortedSet
108+ nes.map(p).toSortedSet should === (set.map(p))
109109 }
110110 }
111111
@@ -177,17 +177,17 @@ class NonEmptySetSuite extends CatsSuite {
177177
178178 test(" fromSet round trip" ) {
179179 forAll { l : SortedSet [Int ] =>
180- NonEmptySet .fromSet(l).map(_.toSet ).getOrElse(SortedSet .empty[Int ]) should === (l)
180+ NonEmptySet .fromSet(l).map(_.toSortedSet ).getOrElse(SortedSet .empty[Int ]) should === (l)
181181 }
182182
183183 forAll { nes : NonEmptySet [Int ] =>
184- NonEmptySet .fromSet(nes.toSet ) should === (Some (nes))
184+ NonEmptySet .fromSet(nes.toSortedSet ) should === (Some (nes))
185185 }
186186 }
187187
188188 test(" fromSetUnsafe/fromSet consistency" ) {
189189 forAll { nes : NonEmptySet [Int ] =>
190- NonEmptySet .fromSet(nes.toSet ) should === (Some (NonEmptySet .fromSetUnsafe(nes.toSet )))
190+ NonEmptySet .fromSet(nes.toSortedSet ) should === (Some (NonEmptySet .fromSetUnsafe(nes.toSortedSet )))
191191 }
192192 }
193193
@@ -199,32 +199,32 @@ class NonEmptySetSuite extends CatsSuite {
199199
200200 test(" + consistent with Set" ) {
201201 forAll { (nes : NonEmptySet [Int ], i : Int ) =>
202- (nes + i).toSet should === (nes.toSet + i)
202+ (nes + i).toSortedSet should === (nes.toSortedSet + i)
203203 }
204204 }
205205
206206 test(" NonEmptySet#zipWithIndex is consistent with Set#zipWithIndex" ) {
207207 forAll { nes : NonEmptySet [Int ] =>
208- nes.zipWithIndex.toSet should === (nes.toSet .zipWithIndex)
208+ nes.zipWithIndex.toSortedSet should === (nes.toSortedSet .zipWithIndex)
209209 }
210210 }
211211
212212 test(" NonEmptySet#size and length is consistent with Set#size" ) {
213213 forAll { nes : NonEmptySet [Int ] =>
214- nes.size should === (nes.toSet .size)
215- nes.length should === (nes.toSet .size)
214+ nes.size should === (nes.toSortedSet .size)
215+ nes.length should === (nes.toSortedSet .size)
216216 }
217217 }
218218
219219 test(" NonEmptySet#concat is consistent with Set#++" ) {
220220 forAll { (nes : NonEmptySet [Int ], l : SortedSet [Int ], n : Int ) =>
221- nes.concat (NonEmptySet (n, l)).toSet should === (nes.toSet ++ (l + n))
221+ nes.union (NonEmptySet (n, l)).toSortedSet should === (nes.toSortedSet ++ (l + n))
222222 }
223223 }
224224
225225 test(" NonEmptySet#zipWith is consistent with Set#zip and then Set#map" ) {
226226 forAll { (a : NonEmptySet [Int ], b : NonEmptySet [Int ], f : (Int , Int ) => Int ) =>
227- a.zipWith(b)(f).toSet should === (a.toSet .zip(b.toSet ).map { case (x, y) => f(x, y) })
227+ a.zipWith(b)(f).toSortedSet should === (a.toSortedSet .zip(b.toSortedSet ).map { case (x, y) => f(x, y) })
228228 }
229229 }
230230
0 commit comments