Files
8bitMyGoUI/pixel/art_internal_test.go
T
ZacharyZhang-NY 51af14709d Add code components 366-385; ScrollArea Follow, editor sync
A terminal with history, a Go-colored code block, a log viewer that
follows, a hex viewer, a memory map, a JSON tree, a line diff, a GAME
OVER crash screen, an FPS meter, profiler bars, breakpoints,
variables, command history, a shortcut list, a debug grid, a pixel
editor that exports string art, a palette editor, a sprite sheet, a
glyph map and a 6502 register view.

layout.ScrollArea takes Follow, and ChatLog now uses it. data.TreeNode
takes a Value drawn in its Slot. pixel gains Has, and Sprite.Art
writes MustSprite art. pixel.Editor takes the caller's value at each
input event, so a value changed between frames is never typed onto.
2026-10-12 07:18:30 -04:00

22 lines
529 B
Go

package pixel
import "testing"
func TestArtRoundTrips(t *testing.T) {
art := "#a.\n.kr\n\n...\nmA#\n"
sp := MustSprite(art)
if got := sp.Art(); got != art {
t.Fatalf("Art() = %q, want %q", got, art)
}
one := SpriteOf(2, 1, func(x, y int) (Slot, bool) { return Good, x == 1 })
if got := one.Art(); got != ".g\n" {
t.Fatalf("SpriteOf Art() = %q", got)
}
}
func TestHasKnowsTofu(t *testing.T) {
if !Has('A') || !Has('中') || !Has('♪') || Has('拖') || Has('\u0378') {
t.Fatal("Has does not match the font")
}
}