@@ -9,10 +9,11 @@ import Foundation
99import Testing
1010@testable import ATCryptography
1111
12- struct Base64URLSuite {
12+ @Suite
13+ struct `Base64URL Encoding and Decoding` {
1314
14- @Test ( " Encodes bytes to a Base64URL string. " )
15- func encodeURL ( ) {
15+ @Test
16+ func `Encodes bytes to a Base 64 URL string` () {
1617 let input : [ UInt8 ] = [ 0x8f , 0x2b , 0x7b , 0x4b , 0x9e , 0xa3 , 0x38 , 0x99 , 0x63 , 0x49 , 0x05 , 0x91 , 0x10 ]
1718 let expectedOutput = " jyt7S56jOJljSQWREA "
1819
@@ -21,8 +22,8 @@ struct Base64URLSuite {
2122 #expect( Base64URL . encodeURL ( data) == expectedOutput)
2223 }
2324
24- @Test ( " Encodes bytes to a Base64URLPad string. " )
25- func encodeURLPad ( ) {
25+ @Test
26+ func `Encodes bytes to a Base 64 URLPad string` () {
2627 let input : [ UInt8 ] = [ 0x8f , 0x2b , 0x7b , 0x4b , 0x9e , 0xa3 , 0x38 , 0x99 , 0x63 , 0x49 , 0x05 , 0x91 , 0x10 , 0x0f , 0xfe ]
2728 let expectedOutput = " jyt7S56jOJljSQWREA_- "
2829
@@ -31,8 +32,8 @@ struct Base64URLSuite {
3132 #expect( Base64URL . encodeURLPad ( data) == expectedOutput)
3233 }
3334
34- @Test ( " Decodes a Base64URL string to an array of bytes. " )
35- func decodeURL ( ) {
35+ @Test
36+ func `Decodes a Base 64 URL string to an array of bytes` () {
3637 let input = " jyt7S56jOJljSQWREA "
3738 let expectedOutput : [ UInt8 ] = [ 0x8f , 0x2b , 0x7b , 0x4b , 0x9e , 0xa3 , 0x38 , 0x99 , 0x63 , 0x49 , 0x05 , 0x91 , 0x10 ]
3839
@@ -41,8 +42,8 @@ struct Base64URLSuite {
4142 #expect( base64URL == Data ( expectedOutput) )
4243 }
4344
44- @Test ( " Decodes a BaseURLPad string to an array of bytes. " )
45- func decodeURLPad ( ) {
45+ @Test
46+ func `Decodes a BaseURLPad string to an array of bytes` () {
4647 let input = " jyt7S56jOJljSQWREA_- "
4748 let expectOutput : [ UInt8 ] = [ 0x8f , 0x2b , 0x7b , 0x4b , 0x9e , 0xa3 , 0x38 , 0x99 , 0x63 , 0x49 , 0x05 , 0x91 , 0x10 , 0x0f , 0xfe ]
4849
@@ -51,35 +52,35 @@ struct Base64URLSuite {
5152 #expect( base64URLPad == Data ( expectOutput) )
5253 }
5354
54- @Test ( " Decodes an invalid Base64URL (contains illegal character). " )
55- func decodeInvalidCharacter ( ) {
55+ @Test
56+ func `Decodes an invalid Base 64 URL ( contains illegal character ) ` () {
5657 let input = " jyt7S56jOJljSQ#REA_- "
5758
5859 let base64URL = Base64URL . decodeURL ( input)
5960
6061 #expect( base64URL == nil )
6162 }
6263
63- @Test ( " Decodes an invalid Base64URLPad (contains illegal character). " )
64- func decodeInvalidCharacterPad ( ) {
64+ @Test
65+ func `Decodes an invalid Base 64 URLPad ( contains illegal character ) ` () {
6566 let input = " jyt7S56jOJljSQ#REA_- "
6667
6768 let base64URLPad = Base64URL . decodeURLPad ( input)
6869
6970 #expect( base64URLPad == nil )
7071 }
7172
72- @Test ( " Decodes an empty string (Base64URL) " )
73- func decodeEmptyBase64URLString ( ) async throws {
73+ @Test
74+ func `Decodes an empty string ( Base64URL ) `() {
7475 let input = " "
7576
7677 let base64URL = Base64URL . decodeURL ( input)
7778
7879 #expect( base64URL == Data ( ) )
7980 }
8081
81- @Test ( " Decodes an empty string (Base64URLPad) " )
82- func decodeEmptyBase64URLPadString ( ) async throws {
82+ @Test
83+ func `Decodes an empty string ( Base64URLPad ) `() {
8384 let input = " "
8485
8586 let base64URLPad = Base64URL . decodeURLPad ( input)
0 commit comments