~taiite/public-inbox

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch

[PATCH senpai] ui: fix editor tests

Details
Message ID
<20210716054613.7526-1-yyp@disroot.org>
DKIM signature
pass
Download raw message
Patch: +10 -5
---
delthas broke them, follow up with fixing line splitting

 ui/editor_test.go | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/ui/editor_test.go b/ui/editor_test.go
index ea2b165..d670e0e 100644
--- a/ui/editor_test.go
+++ b/ui/editor_test.go
@@ -51,7 +51,8 @@ func assertEditorEq(t *testing.T, actual, expected Editor) {
}

func TestOneLetter(t *testing.T) {
	e := NewEditor(5, nil)
	e := NewEditor(nil)
	e.Resize(5)
	e.PutRune('h')
	assertEditorEq(t, e, Editor{
		text:      [][]rune{[]rune{'h'}},
@@ -63,7 +64,8 @@ func TestOneLetter(t *testing.T) {
}

func TestFourLetters(t *testing.T) {
	e := NewEditor(5, nil)
	e := NewEditor(nil)
	e.Resize(5)
	e.PutRune('h')
	e.PutRune('e')
	e.PutRune('l')
@@ -72,7 +74,8 @@ func TestFourLetters(t *testing.T) {
}

func TestOneLeft(t *testing.T) {
	e := NewEditor(5, nil)
	e := NewEditor(nil)
	e.Resize(5)
	e.PutRune('h')
	e.PutRune('l')
	e.Left()
@@ -83,7 +86,8 @@ func TestOneLeft(t *testing.T) {
}

func TestOneRem(t *testing.T) {
	e := NewEditor(5, nil)
	e := NewEditor(nil)
	e.Resize(5)
	e.PutRune('h')
	e.PutRune('l')
	e.RemRune()
@@ -94,7 +98,8 @@ func TestOneRem(t *testing.T) {
}

func TestLeftAndRem(t *testing.T) {
	e := NewEditor(5, nil)
	e := NewEditor(nil)
	e.Resize(5)
	e.PutRune('h')
	e.PutRune('l')
	e.PutRune('e')
--
2.32.0
Reply to thread Export thread (mbox)