(t *testing.T)
| 40 | } |
| 41 | |
| 42 | func TestCompressionRLEDecode(t *testing.T) { |
| 43 | tests := []struct { |
| 44 | name string |
| 45 | data string |
| 46 | want string |
| 47 | }{ |
| 48 | { |
| 49 | name: "test 1", |
| 50 | data: "12W1B12W3B", |
| 51 | want: "WWWWWWWWWWWWBWWWWWWWWWWWWBBB", |
| 52 | }, |
| 53 | { |
| 54 | name: "test 2", |
| 55 | data: "2A1B3C1D4E", |
| 56 | want: "AABCCCDEEEE", |
| 57 | }, |
| 58 | { |
| 59 | name: "test 3", |
| 60 | data: "4A3B2C1D1A", |
| 61 | want: "AAAABBBCCDA", |
| 62 | }, |
| 63 | } |
| 64 | |
| 65 | for _, tt := range tests { |
| 66 | t.Run(tt.name, func(t *testing.T) { |
| 67 | if got := compression.RLEdecode(tt.data); got != tt.want { |
| 68 | t.Errorf("RLEdecode() = %v, want %v", got, tt.want) |
| 69 | } |
| 70 | }) |
| 71 | } |
| 72 | } |
| 73 | |
| 74 | func TestCompressionRLEncodeBytes(t *testing.T) { |
| 75 | tests := []struct { |
nothing calls this directly
no test coverage detected