Skip to content

Commit d143470

Browse files
author
Dr. Brandon Wiley
committed
Merge branch 'main' of github.com:OperatorFoundation/CodexKotlin
2 parents 29a24fd + 170efa6 commit d143470

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

Codex/src/test/java/org/operatorfoundation/codex/EncoderDecoderTest.kt

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,4 +408,34 @@ class SymbolTest {
408408
assertEquals(0, Required('Q').size())
409409
assertEquals(3, Trinary.size())
410410
}
411+
412+
// @Test
413+
// fun testRequiredSymbolValidation()
414+
// {
415+
// // Test that Required symbol validates correctly
416+
// val decoder = Decoder(listOf(Required('X'.code.toByte()), Number()))
417+
//
418+
// // Should decode successfully with 'X'
419+
// val validInput = listOf("X".toByteArray(), "5".toByteArray())
420+
// val result = decoder.decode(validInput)
421+
// assertEquals(BigInteger.valueOf(5), result)
422+
//
423+
// // Should throw with wrong required character
424+
// val invalidInput = listOf("Y".toByteArray(), "5".toByteArray())
425+
// assertThrows(IllegalArgumentException::class.java) {
426+
// decoder.decode(invalidInput)
427+
// }
428+
// }
429+
//
430+
// @Test
431+
// fun testEncoderOverflow()
432+
// {
433+
// // Test that encoder throws when value is too large
434+
// val encoder = Encoder(listOf(Binary(), Binary())) // Max value = 3
435+
//
436+
// assertThrows(Exception::class.java) {
437+
// encoder.encode(BigInteger.valueOf(4))
438+
// }
439+
// }
440+
411441
}

0 commit comments

Comments
 (0)