~taiite/public-inbox

senpai: ui: fix editor tests v1 APPLIED

Alexey Yerin: 1
 ui: fix editor tests

 1 files changed, 10 insertions(+), 5 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~taiite/public-inbox/patches/23859/mbox | git am -3
Learn more about email & git
View this thread in the archives

[PATCH senpai] ui: fix editor tests Export this patch

---
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
Thanks for keeping the tests up to date.

Pushed the patch.