| /* |
| * 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.alldistinct |
| |
| // |
| // NOTE: THIS FILE IS AUTO-GENERATED by the AllDistinctTestGenerator.kt |
| // See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib |
| // |
| |
| import kotlin.test.* |
| |
| class AllDistinctULongArrayTest { |
| |
| @Test |
| fun allDistinct() { |
| assertTrue(ulongArrayOf().allDistinct()) |
| assertTrue(ulongArrayOf(1uL).allDistinct()) |
| assertTrue(ulongArrayOf(1uL, 2uL).allDistinct()) |
| assertFalse(ulongArrayOf(1uL, 1uL).allDistinct()) |
| assertFalse(ulongArrayOf(2uL, 2uL).allDistinct()) |
| assertFalse(ulongArrayOf(1uL, 2uL, 1uL).allDistinct()) |
| assertFalse(ulongArrayOf(2uL, 1uL, 2uL).allDistinct()) |
| } |
| |
| @Test |
| fun allDistinctBy() { |
| assertTrue(ulongArrayOf().allDistinctBy { it % 2uL }) |
| assertTrue(ulongArrayOf(1uL).allDistinctBy { it % 2uL }) |
| assertTrue(ulongArrayOf(1uL).allDistinctBy { error("should not be called") }) |
| assertTrue(ulongArrayOf(1uL, 2uL).allDistinctBy { it % 2uL }) |
| assertFalse(ulongArrayOf(1uL, 3uL, 5uL).allDistinctBy { it % 2uL }) |
| assertFalse(ulongArrayOf(1uL, 2uL).allDistinctBy { 0 }) |
| assertFalse(ulongArrayOf(1uL, 2uL).allDistinctBy { null }) |
| } |
| } |