| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
package vt |
| 16 |
|
| 17 |
import "testing" |
| 18 |
|
| 19 |
func TestPmStrings(t *testing.T) { |
| 20 |
pm := PmAutoMargin |
| 21 |
if s := pm.Enable(); s != "\x1b[?7h" { |
| 22 |
t.Errorf("enable string wrong: %s", s) |
| 23 |
} |
| 24 |
if s := pm.Disable(); s != "\x1b[?7l" { |
| 25 |
t.Errorf("disable string wrong: %s", s) |
| 26 |
} |
| 27 |
if s := pm.Query(); s != "\x1b[?7$p" { |
| 28 |
t.Errorf("query string wrong: %s", s) |
| 29 |
} |
| 30 |
if s := pm.Reply(ModeNA); s != "\x1b[?7;0$y" { |
| 31 |
t.Errorf("reply(NA) string wrong: %s", s) |
| 32 |
} |
| 33 |
if s := pm.Reply(ModeOn); s != "\x1b[?7;1$y" { |
| 34 |
t.Errorf("reply(On) string wrong: %s", s) |
| 35 |
} |
| 36 |
if s := pm.Reply(ModeOff); s != "\x1b[?7;2$y" { |
| 37 |
t.Errorf("reply(Off) string wrong: %s", s) |
| 38 |
} |
| 39 |
if s := pm.Reply(ModeOnLocked); s != "\x1b[?7;3$y" { |
| 40 |
t.Errorf("reply(OnLocked) string wrong: %s", s) |
| 41 |
} |
| 42 |
if s := pm.Reply(ModeOffLocked); s != "\x1b[?7;4$y" { |
| 43 |
t.Errorf("reply(OffLocked) string wrong: %s", s) |
| 44 |
} |
| 45 |
} |