@@ 122-139 (lines=18) @@ | ||
119 | assert history.current() == 'foobarhoge' |
|
120 | ||
121 | ||
122 | def test_previous_match_without_match(prompt): |
|
123 | prompt.text = 'fool' |
|
124 | prompt.caret.get_backward_text.return_value = 'Hello' |
|
125 | history = History(prompt) |
|
126 | assert history.current() == 'fool' |
|
127 | ||
128 | assert history.previous_match() == 'fool' |
|
129 | assert history.current() == 'fool' |
|
130 | ||
131 | ||
132 | def test_next_match(prompt): |
|
133 | prompt.text = 'fool' |
|
134 | prompt.caret.get_backward_text.return_value = 'fo' |
|
135 | history = History(prompt) |
|
136 | [history.previous() for i in range(6)] |
|
137 | assert history.current() == 'foobarhoge' |
|
138 | ||
139 | assert history.next_match() == 'foobar' |
|
140 | assert history.current() == 'foobar' |
|
141 | ||
142 | assert history.next_match() == 'foo' |
|
@@ 103-119 (lines=17) @@ | ||
100 | assert history.current() == 'fool' |
|
101 | ||
102 | ||
103 | def test_previous_match(prompt): |
|
104 | prompt.text = 'fool' |
|
105 | prompt.caret.get_backward_text.return_value = 'fo' |
|
106 | history = History(prompt) |
|
107 | assert history.current() == 'fool' |
|
108 | ||
109 | assert history.previous_match() == 'foo' |
|
110 | assert history.current() == 'foo' |
|
111 | ||
112 | assert history.previous_match() == 'foobar' |
|
113 | assert history.current() == 'foobar' |
|
114 | ||
115 | assert history.previous_match() == 'foobarhoge' |
|
116 | assert history.current() == 'foobarhoge' |
|
117 | ||
118 | assert history.previous_match() == 'foobarhoge' |
|
119 | assert history.current() == 'foobarhoge' |
|
120 | ||
121 | ||
122 | def test_previous_match_without_match(prompt): |