@@ -4,9 +4,6 @@ import androidx.compose.ui.text.TextRange
4
4
import androidx.compose.ui.text.input.TextFieldValue
5
5
import io.kotest.assertions.throwables.shouldThrow
6
6
import io.kotest.core.spec.style.StringSpec
7
- import io.kotest.matchers.collections.shouldContainExactly
8
- import io.kotest.matchers.collections.shouldNotContain
9
- import io.kotest.matchers.collections.shouldNotContainExactly
10
7
import io.kotest.matchers.shouldBe
11
8
import jp.kaleidot725.texteditor.state.EditableTextEditorState
12
9
import java.security.InvalidParameterException
@@ -20,11 +17,13 @@ class EditableTextEditorStateTest : StringSpec({
20
17
state.fields[0 ].isSelected shouldBe true
21
18
}
22
19
" initialize_when_text_is_not_empty" {
23
- val state = EditableTextEditorState ("""
20
+ val state = EditableTextEditorState (
21
+ """
24
22
one
25
23
two
26
24
three
27
- """.trimIndent().lines())
25
+ """.trimIndent().lines()
26
+ )
28
27
29
28
state.fields.count() shouldBe 3
30
29
state.fields[0 ].value shouldBe TextFieldValue (text = "one")
@@ -52,7 +51,7 @@ class EditableTextEditorStateTest : StringSpec({
52
51
53
52
state.fields.count() shouldBe 2
54
53
state.fields[0 ].value shouldBe TextFieldValue (text = "")
55
- state.fields[0 ].isSelected shouldBe false
54
+ state.fields[0 ].isSelected shouldBe false
56
55
state.fields[1 ].value shouldBe TextFieldValue (text = "")
57
56
state.fields[1 ].isSelected shouldBe true
58
57
@@ -66,7 +65,7 @@ class EditableTextEditorStateTest : StringSpec({
66
65
67
66
state.fields.count() shouldBe 2
68
67
state.fields[0 ].value shouldBe TextFieldValue (text = "aaa")
69
- state.fields[0 ].isSelected shouldBe false
68
+ state.fields[0 ].isSelected shouldBe false
70
69
state.fields[1 ].value shouldBe TextFieldValue (text = "")
71
70
state.fields[1 ].isSelected shouldBe true
72
71
@@ -80,7 +79,7 @@ class EditableTextEditorStateTest : StringSpec({
80
79
81
80
state.fields.count() shouldBe 2
82
81
state.fields[0 ].value shouldBe TextFieldValue (text = "aa")
83
- state.fields[0 ].isSelected shouldBe false
82
+ state.fields[0 ].isSelected shouldBe false
84
83
state.fields[1 ].value shouldBe TextFieldValue (text = "aa")
85
84
state.fields[1 ].isSelected shouldBe true
86
85
@@ -94,11 +93,11 @@ class EditableTextEditorStateTest : StringSpec({
94
93
95
94
state.fields.count() shouldBe 4
96
95
state.fields[0 ].value shouldBe TextFieldValue (text = "a")
97
- state.fields[0 ].isSelected shouldBe false
96
+ state.fields[0 ].isSelected shouldBe false
98
97
state.fields[1 ].value shouldBe TextFieldValue (text = "b")
99
- state.fields[1 ].isSelected shouldBe false
98
+ state.fields[1 ].isSelected shouldBe false
100
99
state.fields[2 ].value shouldBe TextFieldValue (text = "c")
101
- state.fields[2 ].isSelected shouldBe false
100
+ state.fields[2 ].isSelected shouldBe false
102
101
state.fields[3 ].value shouldBe TextFieldValue (text = "d")
103
102
state.fields[3 ].isSelected shouldBe true
104
103
@@ -161,6 +160,7 @@ class EditableTextEditorStateTest : StringSpec({
161
160
}
162
161
" delete_field_when_fields_are_not_zero" {
163
162
val state = EditableTextEditorState ("abc\n".lines())
163
+
164
164
state.selectField(1)
165
165
166
166
state.fields.count() shouldBe 2
@@ -176,9 +176,9 @@ class EditableTextEditorStateTest : StringSpec({
176
176
177
177
state.fields.count() shouldBe 1
178
178
state.fields[0 ].value shouldBe TextFieldValue (
179
- text ="abc", selection = TextRange ("abc".count())
179
+ text = "abc", selection = TextRange ("abc".count())
180
180
)
181
- state.fields[0 ].isSelected shouldBe true
181
+ state.fields[0 ].isSelected shouldBe true
182
182
state.lines.count() shouldBe 1
183
183
state.lines[0 ] shouldBe " abc"
184
184
}
@@ -199,8 +199,8 @@ class EditableTextEditorStateTest : StringSpec({
199
199
200
200
state.fields.count() shouldBe 1
201
201
state.fields[0 ].value shouldBe
202
- TextFieldValue (text ="abcdef", selection = TextRange ("abc".count()))
203
- state.fields[0 ].isSelected shouldBe true
202
+ TextFieldValue (text = "abcdef", selection = TextRange ("abc".count()))
203
+ state.fields[0 ].isSelected shouldBe true
204
204
state.lines.count() shouldBe 1
205
205
state.lines[0 ] shouldBe " abcdef"
206
206
}
0 commit comments