Some checks failed
[REUSE] Code Quality / REUSE (push) Has been cancelled
[Swift] Code Quality / Swift ${{ matrix.swift }} on ${{ matrix.os }} (macos-latest) (push) Has been cancelled
[Swift] Code Quality / Swift ${{ matrix.swift }} on ${{ matrix.os }} (ubuntu-latest) (push) Has been cancelled
[Swift] Test / Swift ${{ matrix.swift }} on ${{ matrix.os }} (macos-latest) (push) Has been cancelled
[Swift] Test / Swift ${{ matrix.swift }} on ${{ matrix.os }} (ubuntu-latest) (push) Has been cancelled
25 lines
491 B
Swift
25 lines
491 B
Swift
// SPDX-FileCopyrightText: 2024-2026 Neptuwunium <ada@chronovore.dev>
|
|
// SPDX-License-Identifier: EUPL-1.2
|
|
|
|
import Foundation
|
|
import Testing
|
|
|
|
@testable import Myna
|
|
|
|
struct UnsafeDataExtensionTests {
|
|
@Test func random() async throws {
|
|
let data = try Data.random(count: 16)
|
|
#expect(data.count == 16)
|
|
#expect(
|
|
!data.allSatisfy { value in
|
|
value == 0
|
|
})
|
|
}
|
|
|
|
@Test func randomZero() async throws {
|
|
#expect(throws: MynaError.systemError) {
|
|
try Data.random(count: 0)
|
|
}
|
|
}
|
|
}
|