Package dmd implements well-known formats for dot-matrix display (DMD) art.
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.

31 lines
589 B

2 years ago
2 years ago
2 years ago
2 years ago
  1. package dmd
  2. import (
  3. "os"
  4. "path/filepath"
  5. "testing"
  6. )
  7. func TestReadColoring(t *testing.T) {
  8. tests := []struct {
  9. Name string
  10. }{
  11. {filepath.Join("vpin", "ID4_1.00.pal")},
  12. {"smb.pal"},
  13. }
  14. for _, test := range tests {
  15. t.Run(test.Name, func(it *testing.T) {
  16. f, err := os.Open(filepath.Join("testdata", test.Name))
  17. if err != nil {
  18. it.Skip(err)
  19. }
  20. defer f.Close()
  21. c, err := DecodePin2DMDColoring(f)
  22. if err != nil {
  23. it.Fatal(err)
  24. }
  25. it.Logf("%s: %d palettes, %d mappings, %d masks", f.Name(), len(c.Palettes), len(c.Mappings), len(c.Masks))
  26. })
  27. }
  28. }