(t *testing.T)
| 69 | } |
| 70 | |
| 71 | func TestNewMasterKeyFromKeyIDString(t *testing.T) { |
| 72 | tests := []struct { |
| 73 | name string |
| 74 | keyIDString string |
| 75 | expectErr bool |
| 76 | expectKeyCount int |
| 77 | expectKeys []MasterKey |
| 78 | }{ |
| 79 | { |
| 80 | name: "single key ID", |
| 81 | keyIDString: testKeyID1, |
| 82 | expectKeyCount: 1, |
| 83 | expectKeys: []MasterKey{ |
| 84 | { |
| 85 | KeyID: testKeyID1, |
| 86 | Region: "tr-west-1", |
| 87 | KeyUUID: "12345678-1234-1234-1234-123456789abc", |
| 88 | }, |
| 89 | }, |
| 90 | }, |
| 91 | { |
| 92 | name: "multiple key IDs", |
| 93 | keyIDString: testKeyID1 + "," + testKeyID2, |
| 94 | expectKeyCount: 2, |
| 95 | expectKeys: []MasterKey{ |
| 96 | { |
| 97 | KeyID: testKeyID1, |
| 98 | Region: "tr-west-1", |
| 99 | KeyUUID: "12345678-1234-1234-1234-123456789abc", |
| 100 | }, |
| 101 | { |
| 102 | KeyID: testKeyID2, |
| 103 | Region: "tr-west-1", |
| 104 | KeyUUID: "87654321-4321-4321-4321-cba987654321", |
| 105 | }, |
| 106 | }, |
| 107 | }, |
| 108 | { |
| 109 | name: "multiple key IDs with spaces", |
| 110 | keyIDString: " " + testKeyID1 + " , " + testKeyID2 + " ", |
| 111 | expectKeyCount: 2, |
| 112 | expectKeys: []MasterKey{ |
| 113 | { |
| 114 | KeyID: testKeyID1, |
| 115 | Region: "tr-west-1", |
| 116 | KeyUUID: "12345678-1234-1234-1234-123456789abc", |
| 117 | }, |
| 118 | { |
| 119 | KeyID: testKeyID2, |
| 120 | Region: "tr-west-1", |
| 121 | KeyUUID: "87654321-4321-4321-4321-cba987654321", |
| 122 | }, |
| 123 | }, |
| 124 | }, |
| 125 | { |
| 126 | name: "empty string", |
| 127 | keyIDString: "", |
| 128 | expectKeyCount: 0, |
nothing calls this directly
no test coverage detected