File tree Expand file tree Collapse file tree 1 file changed +0
-4
lines changed
core-scala/src/test/scala/com/baeldung/scala/equality Expand file tree Collapse file tree 1 file changed +0
-4
lines changed Original file line number Diff line number Diff line change @@ -5,9 +5,7 @@ import org.scalatest.FlatSpec
5
5
class EqualityTest extends FlatSpec {
6
6
" Equality operator for AnyVal" should " work as in Java" in {
7
7
val intAnyVal = 4
8
- val booleanAnyVal = false
9
8
assert(intAnyVal == 2 * 2 )
10
- assert((intAnyVal > 10 ) == booleanAnyVal)
11
9
}
12
10
13
11
" Equality operator for referential types" should " work like null-safe equals()" in {
@@ -24,9 +22,7 @@ class EqualityTest extends FlatSpec {
24
22
" Equals()" should " work as in Java" in {
25
23
val str1 = new String (" AnyRef" )
26
24
val str2 = new String (" AnyRef" )
27
- val str3 = null
28
25
assert(str1.equals(str2))
29
- assertThrows[NullPointerException ](str3.equals(str2))
30
26
}
31
27
32
28
" Eq and ne" should " check referential equality" in {
You can’t perform that action at this time.
0 commit comments