You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Base64Test.kt 539B

1234567891011121314151617181920
  1. package com.dmdirc.ktirc.util
  2. import com.dmdirc.ktirc.sasl.fromBase64
  3. import com.dmdirc.ktirc.sasl.toBase64
  4. import org.junit.jupiter.api.Assertions.assertEquals
  5. import org.junit.jupiter.api.Test
  6. class Base64Test {
  7. @Test
  8. fun `encodes byte arrays into base64`() {
  9. assertEquals("SGFjayB0aGUgUGxhbmV0", "Hack the Planet".toByteArray().toBase64())
  10. }
  11. @Test
  12. fun `decodes byte arrays from base64`() {
  13. assertEquals("Hack the Planet", String("SGFjayB0aGUgUGxhbmV0".fromBase64()))
  14. }
  15. }