blob: 6ed86120447a84bd1042fcb354f979ab7b000dec [file]
/*
* Copyright 2010-2026 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package test.generated.allequal
//
// NOTE: THIS FILE IS AUTO-GENERATED by the AllEqualTestGenerator.kt
// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib
//
import kotlin.test.*
class AllEqualLongArrayTest {
@Test
fun allEqual() {
assertTrue(longArrayOf().allEqual())
assertTrue(longArrayOf(1L).allEqual())
assertTrue(longArrayOf(1L, 1L).allEqual())
assertTrue(longArrayOf(1L, 1L, 1L).allEqual())
assertFalse(longArrayOf(1L, 2L).allEqual())
assertFalse(longArrayOf(2L, 1L).allEqual())
assertFalse(longArrayOf(1L, 1L, 2L).allEqual())
assertFalse(longArrayOf(2L, 1L, 1L).allEqual())
}
@Test
fun allEqualBy() {
assertTrue(longArrayOf().allEqualBy { it * it })
assertTrue(longArrayOf(1L).allEqualBy { it * it })
assertTrue(longArrayOf(1L).allEqualBy { error("should not be called") })
assertTrue(longArrayOf(1L, -1L, 1L).allEqualBy { it * it })
assertFalse(longArrayOf(1L, 2L).allEqualBy { it * it })
assertTrue(longArrayOf(1L, 2L).allEqualBy { 0 })
assertTrue(longArrayOf(1L, -1L, 1L).allEqualBy { null })
}
}