From bae13291708d3a19a1602108cfe246406867dbda Mon Sep 17 00:00:00 2001 From: Jakub Sobon Date: Sun, 3 Feb 2019 19:59:19 -0500 Subject: [PATCH] Remainder of the ASCII table. --- draw/segdisp/sixteen/sixteen.go | 30 ++++ draw/segdisp/sixteen/sixteen_test.go | 210 +++++++++++++++++++++++++++ 2 files changed, 240 insertions(+) diff --git a/draw/segdisp/sixteen/sixteen.go b/draw/segdisp/sixteen/sixteen.go index 727f9d5..9580c39 100644 --- a/draw/segdisp/sixteen/sixteen.go +++ b/draw/segdisp/sixteen/sixteen.go @@ -180,7 +180,37 @@ var characterSegments = map[rune][]Segment{ '_': {D1, D2}, '`': {H}, + 'a': {G1, E, M, D1, D2}, + 'b': {F, G1, E, M, D1}, + 'c': {G1, E, D1}, + 'd': {B, G2, M, C, D2}, + 'e': {G1, E, N, D1}, + 'f': {A2, J, G1, G2, M}, + 'g': {A1, F, J, G1, M, D1}, + 'h': {F, G1, E, M}, + 'i': {M}, + 'j': {J, E, M, D1}, + 'k': {J, K, M, L}, + 'l': {F, E}, + 'm': {G1, G2, E, M, C}, + 'n': {G1, E, M}, + 'o': {G1, E, M, D1}, + 'p': {A1, F, J, G1, E}, + 'q': {A1, F, J, G1, M}, + 'r': {G1, E}, + 's': {A1, F, G1, M, D1}, + 't': {F, G1, E, D1}, + 'u': {E, M, D1}, + 'v': {E, N}, 'w': {E, N, L, C}, + 'x': {H, K, N, L}, + 'y': {J, B, G2, C, D2}, + 'z': {G1, N, D1}, + + '{': {A2, J, G1, M, D2}, + '|': {J, M}, + '}': {A1, J, G2, M, D1}, + '~': {K, G1, G2, N}, } // SupportsChars asserts whether the display supports all runes in the diff --git a/draw/segdisp/sixteen/sixteen_test.go b/draw/segdisp/sixteen/sixteen_test.go index cfdc2d5..cca480b 100644 --- a/draw/segdisp/sixteen/sixteen_test.go +++ b/draw/segdisp/sixteen/sixteen_test.go @@ -1350,6 +1350,216 @@ func TestSetCharacter(t *testing.T) { return mustDrawSegments(size, H) }, }, + { + desc: "displays 'a'", + char: 'a', + want: func(size image.Point) *faketerm.Terminal { + return mustDrawSegments(size, G1, E, M, D1, D2) + }, + }, + { + desc: "displays 'b'", + char: 'b', + want: func(size image.Point) *faketerm.Terminal { + return mustDrawSegments(size, F, G1, E, M, D1) + }, + }, + { + desc: "displays 'c'", + char: 'c', + want: func(size image.Point) *faketerm.Terminal { + return mustDrawSegments(size, G1, E, D1) + }, + }, + { + desc: "displays 'd'", + char: 'd', + want: func(size image.Point) *faketerm.Terminal { + return mustDrawSegments(size, B, G2, M, C, D2) + }, + }, + { + desc: "displays 'e'", + char: 'e', + want: func(size image.Point) *faketerm.Terminal { + return mustDrawSegments(size, G1, E, N, D1) + }, + }, + { + desc: "displays 'f'", + char: 'f', + want: func(size image.Point) *faketerm.Terminal { + return mustDrawSegments(size, A2, J, G1, G2, M) + }, + }, + { + desc: "displays 'g'", + char: 'g', + want: func(size image.Point) *faketerm.Terminal { + return mustDrawSegments(size, A1, F, J, G1, M, D1) + }, + }, + { + desc: "displays 'h'", + char: 'h', + want: func(size image.Point) *faketerm.Terminal { + return mustDrawSegments(size, F, G1, E, M) + }, + }, + { + desc: "displays 'i'", + char: 'i', + want: func(size image.Point) *faketerm.Terminal { + return mustDrawSegments(size, M) + }, + }, + { + desc: "displays 'j'", + char: 'j', + want: func(size image.Point) *faketerm.Terminal { + return mustDrawSegments(size, J, E, M, D1) + }, + }, + { + desc: "displays 'k'", + char: 'k', + want: func(size image.Point) *faketerm.Terminal { + return mustDrawSegments(size, J, K, M, L) + }, + }, + { + desc: "displays 'l'", + char: 'l', + want: func(size image.Point) *faketerm.Terminal { + return mustDrawSegments(size, F, E) + }, + }, + { + desc: "displays 'm'", + char: 'm', + want: func(size image.Point) *faketerm.Terminal { + return mustDrawSegments(size, G1, G2, E, M, C) + }, + }, + { + desc: "displays 'n'", + char: 'n', + want: func(size image.Point) *faketerm.Terminal { + return mustDrawSegments(size, G1, E, M) + }, + }, + { + desc: "displays 'o'", + char: 'o', + want: func(size image.Point) *faketerm.Terminal { + return mustDrawSegments(size, G1, E, M, D1) + }, + }, + { + desc: "displays 'p'", + char: 'p', + want: func(size image.Point) *faketerm.Terminal { + return mustDrawSegments(size, A1, F, J, G1, E) + }, + }, + { + desc: "displays 'q'", + char: 'q', + want: func(size image.Point) *faketerm.Terminal { + return mustDrawSegments(size, A1, F, J, G1, M) + }, + }, + { + desc: "displays 'r'", + char: 'r', + want: func(size image.Point) *faketerm.Terminal { + return mustDrawSegments(size, G1, E) + }, + }, + { + desc: "displays 's'", + char: 's', + want: func(size image.Point) *faketerm.Terminal { + return mustDrawSegments(size, A1, F, G1, M, D1) + }, + }, + { + desc: "displays 't'", + char: 't', + want: func(size image.Point) *faketerm.Terminal { + return mustDrawSegments(size, F, G1, E, D1) + }, + }, + { + desc: "displays 'u'", + char: 'u', + want: func(size image.Point) *faketerm.Terminal { + return mustDrawSegments(size, E, M, D1) + }, + }, + { + desc: "displays 'v'", + char: 'v', + want: func(size image.Point) *faketerm.Terminal { + return mustDrawSegments(size, E, N) + }, + }, + { + desc: "displays 'w'", + char: 'w', + want: func(size image.Point) *faketerm.Terminal { + return mustDrawSegments(size, E, N, L, C) + }, + }, + { + desc: "displays 'x'", + char: 'x', + want: func(size image.Point) *faketerm.Terminal { + return mustDrawSegments(size, H, K, N, L) + }, + }, + { + desc: "displays 'y'", + char: 'y', + want: func(size image.Point) *faketerm.Terminal { + return mustDrawSegments(size, J, B, G2, C, D2) + }, + }, + { + desc: "displays 'z'", + char: 'z', + want: func(size image.Point) *faketerm.Terminal { + return mustDrawSegments(size, G1, N, D1) + }, + }, + { + desc: "displays '{'", + char: '{', + want: func(size image.Point) *faketerm.Terminal { + return mustDrawSegments(size, A2, J, G1, M, D2) + }, + }, + { + desc: "displays '|'", + char: '|', + want: func(size image.Point) *faketerm.Terminal { + return mustDrawSegments(size, J, M) + }, + }, + { + desc: "displays '}'", + char: '}', + want: func(size image.Point) *faketerm.Terminal { + return mustDrawSegments(size, A1, J, G2, M, D1) + }, + }, + { + desc: "displays '~'", + char: '~', + want: func(size image.Point) *faketerm.Terminal { + return mustDrawSegments(size, K, G1, G2, N) + }, + }, } for _, tc := range tests {