blob: c7baae7739ac1434f6602c454d3ab7e46d11734e (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
import Foundation
import Testing
@testable import Hutch
@MainActor
struct BuildTaskTests {
@Test
@MainActor
func duplicateTaskNamesProduceDistinctIDsAndLogCacheKeys() {
let firstTask = BuildTask(
name: "test",
status: .failed,
log: BuildLog(fullURL: "https://builds.sr.ht/job/1/task/1")
).withOrdinal(0)
let secondTask = BuildTask(
name: "test",
status: .failed,
log: BuildLog(fullURL: "https://builds.sr.ht/job/1/task/2")
).withOrdinal(1)
#expect(firstTask.id == "0:test")
#expect(secondTask.id == "1:test")
#expect(firstTask.id != secondTask.id)
#expect(firstTask.logCacheKey != secondTask.logCacheKey)
}
}
|