Skip to content

Commit

Permalink
fixed failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gmuth committed Sep 30, 2024
1 parent f57c8cf commit f3eca71
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/test/kotlin/de/gmuth/ipp/core/IppOperationsTests.kt
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
package de.gmuth.ipp.core

/**
* Copyright (c) 2020-2023 Gerhard Muth
* Copyright (c) 2020-2024 Gerhard Muth
*/

import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertFailsWith

class IppOperationsTests {

@Test
fun unknownOperationCodeFails() {
assertFailsWith<IppException> {
IppOperation.fromInt(0)
}
val operation = IppOperation.fromInt(0)
assertEquals(IppOperation.Unknown, operation)
}

}
6 changes: 3 additions & 3 deletions src/test/kotlin/de/gmuth/ipp/core/IppRequestTests.kt
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ class IppRequestTests {
assertEquals("2.0", request.version)
assertEquals(IppOperation.StartupPrinter, request.operation)
assertEquals(Charsets.UTF_8, request.attributesCharset)
assertEquals("en-us", request.operationGroup.getValue("attributes-natural-language"))
assertEquals("en", request.operationGroup.getValue("attributes-natural-language"))
assertEquals("ipp://foo", request.printerOrJobUri.toString())
assertEquals("Startup-Printer", request.codeDescription)
val requestEncoded = request.encode()
assertEquals(100, requestEncoded.size)
assertEquals(97, requestEncoded.size)
}

@Test
Expand All @@ -64,7 +64,7 @@ class IppRequestTests {
assertNotNull(operationGroup)
operationGroup.run {
assertEquals(Charsets.UTF_8, getValue("attributes-charset"))
assertEquals("en-us", getValue("attributes-natural-language"))
assertEquals("en", getValue("attributes-natural-language"))
assertEquals(URI.create("ipp://printer"), getValue("printer-uri"))
}
assertEquals(listOf("one", "two"), requestedAttributes)
Expand Down

0 comments on commit f3eca71

Please sign in to comment.