@@ -354,11 +354,14 @@ public fun assertContains(charSequence: CharSequence, regex: Regex, message: Str
354
354
}
355
355
356
356
/* *
357
- * Asserts that the [expected] iterable is *structurally* equal to the [actual] iterable,
358
- * i.e. contains the same number of the same elements in the same order, with an optional [message].
357
+ * Asserts that the [expected] iterable is *structurally* equal to the [actual] iterable, with an optional [message].
359
358
*
360
- * The elements are compared for equality with the [equals][Any.equals] function.
361
- * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`.
359
+ * Two iterables are considered structurally equal if they have the same size,
360
+ * and elements at corresponding positions, following the iteration order, are equal.
361
+ * Elements are compared for equality using the [equals][Any.equals] function.
362
+ * For floating point numbers, this means `NaN` is equal to itself and `-0.0` is not equal to `0.0`.
363
+ *
364
+ * The iterables are also considered equal if both are `null`.
362
365
*/
363
366
@SinceKotlin(" 1.5" )
364
367
public fun <@OnlyInputTypes T > assertContentEquals (expected : Iterable <T >? , actual : Iterable <T >? , message : String? = null) {
@@ -374,110 +377,140 @@ public fun <@OnlyInputTypes T> assertContentEquals(expected: Set<T>?, actual: Se
374
377
assertContentEquals(expected, actual?.asIterable(), message)
375
378
376
379
/* *
377
- * Asserts that the [expected] sequence is *structurally* equal to the [actual] sequence,
378
- * i.e. contains the same number of the same elements in the same order, with an optional [message].
380
+ * Asserts that the [expected] sequence is *structurally* equal to the [actual] sequence, with an optional [message].
381
+ *
382
+ * Two sequences are considered structurally equal if they have the same size,
383
+ * and elements at corresponding positions, following the iteration order, are equal.
384
+ * Elements are compared for equality using the [equals][Any.equals] function.
385
+ * For floating point numbers, this means `NaN` is equal to itself and `-0.0` is not equal to `0.0`.
379
386
*
380
- * The elements are compared for equality with the [equals][Any.equals] function.
381
- * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`.
387
+ * The sequences are also considered equal if both are `null`.
382
388
*/
383
389
@SinceKotlin(" 1.5" )
384
390
public fun <@OnlyInputTypes T > assertContentEquals (expected : Sequence <T >? , actual : Sequence <T >? , message : String? = null) {
385
391
assertIterableContentEquals(" Sequence" , message, expected, actual, Sequence <* >::iterator)
386
392
}
387
393
388
394
/* *
389
- * Asserts that the [expected] array is *structurally* equal to the [actual] array,
390
- * i.e. contains the same number of the same elements in the same order, with an optional [message].
395
+ * Asserts that the [expected] array is *structurally* equal to the [actual] array, with an optional [message].
391
396
*
392
- * The elements are compared for equality with the [equals][Any.equals] function.
393
- * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`.
397
+ * Two arrays are considered structurally equal if they have the same size, and elements at corresponding indices are equal.
398
+ * Elements are compared for equality using the [equals][Any.equals] function.
399
+ * For floating point numbers, this means `NaN` is equal to itself and `-0.0` is not equal to `0.0`.
400
+ *
401
+ * The arrays are also considered equal if both are `null`.
394
402
*/
395
403
@SinceKotlin(" 1.5" )
396
404
public fun <@OnlyInputTypes T > assertContentEquals (expected : Array <T >? , actual : Array <T >? , message : String? = null) {
397
405
assertArrayContentEquals(message, expected, actual, { it.size }, Array <* >::get, Array <* >? ::contentToString, Array <* >? ::contentEquals)
398
406
}
399
407
400
408
/* *
401
- * Asserts that the [expected] array is *structurally* equal to the [actual] array,
402
- * i.e. contains the same number of the same elements in the same order, with an optional [message].
409
+ * Asserts that the [expected] array is *structurally* equal to the [actual] array, with an optional [message].
410
+ *
411
+ * Two arrays are considered structurally equal if they have the same size, and elements at corresponding indices are equal.
412
+ *
413
+ * The arrays are also considered equal if both are `null`.
403
414
*/
404
415
@SinceKotlin(" 1.5" )
405
416
public fun assertContentEquals (expected : ByteArray? , actual : ByteArray? , message : String? = null) {
406
417
assertArrayContentEquals(message, expected, actual, { it.size }, ByteArray ::get, ByteArray? ::contentToString, ByteArray? ::contentEquals)
407
418
}
408
419
409
420
/* *
410
- * Asserts that the [expected] array is *structurally* equal to the [actual] array,
411
- * i.e. contains the same number of the same elements in the same order, with an optional [message].
421
+ * Asserts that the [expected] array is *structurally* equal to the [actual] array, with an optional [message].
422
+ *
423
+ * Two arrays are considered structurally equal if they have the same size, and elements at corresponding indices are equal.
424
+ *
425
+ * The arrays are also considered equal if both are `null`.
412
426
*/
413
427
@SinceKotlin(" 1.5" )
414
428
public fun assertContentEquals (expected : ShortArray? , actual : ShortArray? , message : String? = null) {
415
429
assertArrayContentEquals(message, expected, actual, { it.size }, ShortArray ::get, ShortArray? ::contentToString, ShortArray? ::contentEquals)
416
430
}
417
431
418
432
/* *
419
- * Asserts that the [expected] array is *structurally* equal to the [actual] array,
420
- * i.e. contains the same number of the same elements in the same order, with an optional [message].
433
+ * Asserts that the [expected] array is *structurally* equal to the [actual] array, with an optional [message].
434
+ *
435
+ * Two arrays are considered structurally equal if they have the same size, and elements at corresponding indices are equal.
436
+ *
437
+ * The arrays are also considered equal if both are `null`.
421
438
*/
422
439
@SinceKotlin(" 1.5" )
423
440
public fun assertContentEquals (expected : IntArray? , actual : IntArray? , message : String? = null) {
424
441
assertArrayContentEquals(message, expected, actual, { it.size }, IntArray ::get, IntArray? ::contentToString, IntArray? ::contentEquals)
425
442
}
426
443
427
444
/* *
428
- * Asserts that the [expected] array is *structurally* equal to the [actual] array,
429
- * i.e. contains the same number of the same elements in the same order, with an optional [message].
445
+ * Asserts that the [expected] array is *structurally* equal to the [actual] array, with an optional [message].
446
+ *
447
+ * Two arrays are considered structurally equal if they have the same size, and elements at corresponding indices are equal.
448
+ *
449
+ * The arrays are also considered equal if both are `null`.
430
450
*/
431
451
@SinceKotlin(" 1.5" )
432
452
public fun assertContentEquals (expected : LongArray? , actual : LongArray? , message : String? = null) {
433
453
assertArrayContentEquals(message, expected, actual, { it.size }, LongArray ::get, LongArray? ::contentToString, LongArray? ::contentEquals)
434
454
}
435
455
436
456
/* *
437
- * Asserts that the [expected] array is *structurally* equal to the [actual] array,
438
- * i.e. contains the same number of the same elements in the same order, with an optional [message].
457
+ * Asserts that the [expected] array is *structurally* equal to the [actual] array, with an optional [message].
458
+ *
459
+ * Two arrays are considered structurally equal if they have the same size, and elements at corresponding indices are equal.
460
+ * Elements are compared for equality using the [equals][Any.equals] function.
461
+ * For floating point numbers, this means `NaN` is equal to itself and `-0.0` is not equal to `0.0`.
439
462
*
440
- * The elements are compared for equality with the [equals][Any.equals] function.
441
- * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`.
463
+ * The arrays are also considered equal if both are `null`.
442
464
*/
443
465
@SinceKotlin(" 1.5" )
444
466
public fun assertContentEquals (expected : FloatArray? , actual : FloatArray? , message : String? = null) {
445
467
assertArrayContentEquals(message, expected, actual, { it.size }, FloatArray ::get, FloatArray? ::contentToString, FloatArray? ::contentEquals)
446
468
}
447
469
448
470
/* *
449
- * Asserts that the [expected] array is *structurally* equal to the [actual] array,
450
- * i.e. contains the same number of the same elements in the same order, with an optional [message].
471
+ * Asserts that the [expected] array is *structurally* equal to the [actual] array, with an optional [message].
472
+ *
473
+ * Two arrays are considered structurally equal if they have the same size, and elements at corresponding indices are equal.
474
+ * Elements are compared for equality using the [equals][Any.equals] function.
475
+ * For floating point numbers, this means `NaN` is equal to itself and `-0.0` is not equal to `0.0`.
451
476
*
452
- * The elements are compared for equality with the [equals][Any.equals] function.
453
- * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`.
477
+ * The arrays are also considered equal if both are `null`.
454
478
*/
455
479
@SinceKotlin(" 1.5" )
456
480
public fun assertContentEquals (expected : DoubleArray? , actual : DoubleArray? , message : String? = null) {
457
481
assertArrayContentEquals(message, expected, actual, { it.size }, DoubleArray ::get, DoubleArray? ::contentToString, DoubleArray? ::contentEquals)
458
482
}
459
483
460
484
/* *
461
- * Asserts that the [expected] array is *structurally* equal to the [actual] array,
462
- * i.e. contains the same number of the same elements in the same order, with an optional [message].
485
+ * Asserts that the [expected] array is *structurally* equal to the [actual] array, with an optional [message].
486
+ *
487
+ * Two arrays are considered structurally equal if they have the same size, and elements at corresponding indices are equal.
488
+ *
489
+ * The arrays are also considered equal if both are `null`.
463
490
*/
464
491
@SinceKotlin(" 1.5" )
465
492
public fun assertContentEquals (expected : BooleanArray? , actual : BooleanArray? , message : String? = null) {
466
493
assertArrayContentEquals(message, expected, actual, { it.size }, BooleanArray ::get, BooleanArray? ::contentToString, BooleanArray? ::contentEquals)
467
494
}
468
495
469
496
/* *
470
- * Asserts that the [expected] array is *structurally* equal to the [actual] array,
471
- * i.e. contains the same number of the same elements in the same order, with an optional [message].
497
+ * Asserts that the [expected] array is *structurally* equal to the [actual] array, with an optional [message].
498
+ *
499
+ * Two arrays are considered structurally equal if they have the same size, and elements at corresponding indices are equal.
500
+ *
501
+ * The arrays are also considered equal if both are `null`.
472
502
*/
473
503
@SinceKotlin(" 1.5" )
474
504
public fun assertContentEquals (expected : CharArray? , actual : CharArray? , message : String? = null) {
475
505
assertArrayContentEquals(message, expected, actual, { it.size }, CharArray ::get, CharArray? ::contentToString, CharArray? ::contentEquals)
476
506
}
477
507
478
508
/* *
479
- * Asserts that the [expected] array is *structurally* equal to the [actual] array,
480
- * i.e. contains the same number of the same elements in the same order, with an optional [message].
509
+ * Asserts that the [expected] array is *structurally* equal to the [actual] array, with an optional [message].
510
+ *
511
+ * Two arrays are considered structurally equal if they have the same size, and elements at corresponding indices are equal.
512
+ *
513
+ * The arrays are also considered equal if both are `null`.
481
514
*/
482
515
@SinceKotlin(" 1.5" )
483
516
@OptIn(ExperimentalUnsignedTypes ::class )
@@ -486,8 +519,11 @@ public fun assertContentEquals(expected: UByteArray?, actual: UByteArray?, messa
486
519
}
487
520
488
521
/* *
489
- * Asserts that the [expected] array is *structurally* equal to the [actual] array,
490
- * i.e. contains the same number of the same elements in the same order, with an optional [message].
522
+ * Asserts that the [expected] array is *structurally* equal to the [actual] array, with an optional [message].
523
+ *
524
+ * Two arrays are considered structurally equal if they have the same size, and elements at corresponding indices are equal.
525
+ *
526
+ * The arrays are also considered equal if both are `null`.
491
527
*/
492
528
@SinceKotlin(" 1.5" )
493
529
@OptIn(ExperimentalUnsignedTypes ::class )
@@ -496,8 +532,11 @@ public fun assertContentEquals(expected: UShortArray?, actual: UShortArray?, mes
496
532
}
497
533
498
534
/* *
499
- * Asserts that the [expected] array is *structurally* equal to the [actual] array,
500
- * i.e. contains the same number of the same elements in the same order, with an optional [message].
535
+ * Asserts that the [expected] array is *structurally* equal to the [actual] array, with an optional [message].
536
+ *
537
+ * Two arrays are considered structurally equal if they have the same size, and elements at corresponding indices are equal.
538
+ *
539
+ * The arrays are also considered equal if both are `null`.
501
540
*/
502
541
@SinceKotlin(" 1.5" )
503
542
@OptIn(ExperimentalUnsignedTypes ::class )
@@ -506,8 +545,11 @@ public fun assertContentEquals(expected: UIntArray?, actual: UIntArray?, message
506
545
}
507
546
508
547
/* *
509
- * Asserts that the [expected] array is *structurally* equal to the [actual] array,
510
- * i.e. contains the same number of the same elements in the same order, with an optional [message].
548
+ * Asserts that the [expected] array is *structurally* equal to the [actual] array, with an optional [message].
549
+ *
550
+ * Two arrays are considered structurally equal if they have the same size, and elements at corresponding indices are equal.
551
+ *
552
+ * The arrays are also considered equal if both are `null`.
511
553
*/
512
554
@SinceKotlin(" 1.5" )
513
555
@OptIn(ExperimentalUnsignedTypes ::class )
0 commit comments