scoop:scoop.test:0.1.0
src/identity.scoop
Selected production source · src/identity.scoop
1
package scoop.test3
/**4
* Checks reference identity rather than value equality and throws [AssertionFailure] for different5
* objects.6
*/7
public fun <T : ref> assertSame(8
expected: T,9
actual: T,10
message: String? = None,11
location: SourceLocation = currentSourceLocation()12
) {13
if (expected !== actual) {14
comparisonFailure("assertSame", expected, actual, message, location)15
}16
}18
/**19
* Throws [AssertionFailure] when both references identify the same object.20
*/21
public fun <T : ref> assertNotSame(22
expected: T,23
actual: T,24
message: String? = None,25
location: SourceLocation = currentSourceLocation()26
) {27
if (expected === actual) {28
comparisonFailure("assertNotSame", expected, actual, message, location)29
}30
}