| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
package iconvg |
| 6 |
|
| 7 |
import ( |
| 8 |
"os" |
| 9 |
"path/filepath" |
| 10 |
"testing" |
| 11 |
) |
| 12 |
|
| 13 |
func TestUpgradeToFileFormatVersion1(t *testing.T) { |
| 14 |
for _, tc := range testdataTestCases { |
| 15 |
original, err := os.ReadFile(filepath.FromSlash(tc.filename) + ".ivg") |
| 16 |
if err != nil { |
| 17 |
t.Errorf("%s: ReadFile: %v", tc.filename, err) |
| 18 |
continue |
| 19 |
} |
| 20 |
|
| 21 |
upgraded, err := UpgradeToFileFormatVersion1(original, nil) |
| 22 |
if err != nil { |
| 23 |
t.Errorf("%s: Upgrade: %v", tc.filename, err) |
| 24 |
continue |
| 25 |
} |
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
if tc.filename == "testdata/action-info.lores" { |
| 37 |
const want = "" + |
| 38 |
"\x8A\x49\x56\x47\x03\x0B\x11\x51\x51\xB1\xB1\x35\x81\x59\x33\x59" + |
| 39 |
"\x81\x81\xA9\x35\x85\x95\x34\x7D\x95\x7D\x7D\x35\x85\x75\x34\x7D" + |
| 40 |
"\x75\x7D\x6D\x88" |
| 41 |
if got := string(upgraded); got != want { |
| 42 |
t.Errorf("%s: Upgrade: got:\n% 02x\nwant:\n% 02x", tc.filename, got, want) |
| 43 |
continue |
| 44 |
} |
| 45 |
} |
| 46 |
} |
| 47 |
} |