Scoop API

scoop:scoop.test:0.1.0

src/identity.scoop

Selected production source · src/identity.scoop

1package scoop.test
3/**
4 * Checks reference identity rather than value equality and throws [AssertionFailure] for different
5 * objects.
6 */
7public 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 }
18/**
19 * Throws [AssertionFailure] when both references identify the same object.
20 */
21public 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 }