@@ 74-100 (lines=27) @@ | ||
71 | assert history.current() == 'foobarhoge' |
|
72 | ||
73 | ||
74 | def test_next(prompt): |
|
75 | prompt.text = 'fool' |
|
76 | prompt.caret.get_backward_text.return_value = 'fo' |
|
77 | history = History(prompt) |
|
78 | [history.previous() for i in range(6)] |
|
79 | assert history.current() == 'foobarhoge' |
|
80 | ||
81 | assert history.next() == 'barhoge' |
|
82 | assert history.current() == 'barhoge' |
|
83 | ||
84 | assert history.next() == 'hoge' |
|
85 | assert history.current() == 'hoge' |
|
86 | ||
87 | assert history.next() == 'foobar' |
|
88 | assert history.current() == 'foobar' |
|
89 | ||
90 | assert history.next() == 'bar' |
|
91 | assert history.current() == 'bar' |
|
92 | ||
93 | assert history.next() == 'foo' |
|
94 | assert history.current() == 'foo' |
|
95 | ||
96 | assert history.next() == 'fool' |
|
97 | assert history.current() == 'fool' |
|
98 | ||
99 | assert history.next() == 'fool' |
|
100 | assert history.current() == 'fool' |
|
101 | ||
102 | ||
103 | def test_previous_match(prompt): |
|
@@ 46-71 (lines=26) @@ | ||
43 | assert history.current() == 'fool' |
|
44 | ||
45 | ||
46 | def test_previous(prompt): |
|
47 | prompt.text = 'fool' |
|
48 | prompt.caret.get_backward_text.return_value = 'fo' |
|
49 | history = History(prompt) |
|
50 | assert history.current() == 'fool' |
|
51 | ||
52 | assert history.previous() == 'foo' |
|
53 | assert history.current() == 'foo' |
|
54 | ||
55 | assert history.previous() == 'bar' |
|
56 | assert history.current() == 'bar' |
|
57 | ||
58 | assert history.previous() == 'foobar' |
|
59 | assert history.current() == 'foobar' |
|
60 | ||
61 | assert history.previous() == 'hoge' |
|
62 | assert history.current() == 'hoge' |
|
63 | ||
64 | assert history.previous() == 'barhoge' |
|
65 | assert history.current() == 'barhoge' |
|
66 | ||
67 | assert history.previous() == 'foobarhoge' |
|
68 | assert history.current() == 'foobarhoge' |
|
69 | ||
70 | assert history.previous() == 'foobarhoge' |
|
71 | assert history.current() == 'foobarhoge' |
|
72 | ||
73 | ||
74 | def test_next(prompt): |