Skip to content

Commit

Permalink
test: add test for metadata subscript
Browse files Browse the repository at this point in the history
  • Loading branch information
lovetodream committed Apr 22, 2024
1 parent df61a49 commit 12c21de
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Tests/LoggingLokiTests/LokiLogHandlerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ final class LokiLogHandlerTests: XCTestCase {
XCTAssertEqual(metadata7, ["hello": "how are you"])
let metadata8 = LokiLogHandler<TestClock>.prepareMetadata(base: ["hello": "there"], provider: .init({ ["hello": "how are you"] }), explicit: ["hello": "I am fine"])
XCTAssertEqual(metadata8, ["hello": "I am fine"])
var handler = LokiLogHandler(label: "test", processor: .init(configuration: .init(lokiURL: "")))
handler[metadataKey: "key"] = "value"
XCTAssertEqual(handler.metadata, ["key": "value"])
XCTAssertEqual(handler[metadataKey: "key"], "value")
}

func checkIfLogExists(for transformer: TestTransformer, file: StaticString = #filePath, line: UInt = #line) throws {
Expand Down

0 comments on commit 12c21de

Please sign in to comment.