added tests for input
This commit is contained in:
parent
d8905971cd
commit
43eb1531cd
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: src/question/input.rs
|
||||
expression: backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│ [38;5;10m? [1m[39mmessage[22m [38;5;8m›[39m [38;5;0m[48;5;7m [39m[49m │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: src/question/input.rs
|
||||
expression: backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│ [38;5;10m? [1m[39mmessage[22m [38;5;8m›[39m inputinputinputinputinputinputinp│
|
||||
│utinputinputinput[38;5;0m[48;5;7m [39m[49m │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: src/question/input.rs
|
||||
expression: backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│ [38;5;10m? [1m[39mmessage[22m [38;5;8m›[39m inputa │
|
||||
│[38;5;6m❯ inputa[39m │
|
||||
│ inputb │
|
||||
│ inputc │
|
||||
│ inputd │
|
||||
│ inpute │
|
||||
│[38;5;0m[48;5;7m [39m[49m │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: src/question/input.rs
|
||||
expression: backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│ [38;5;10m? [1m[39mmessage[22m [38;5;8m›[39m inputb[38;5;0m[48;5;7m [39m[49m │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: src/question/input.rs
|
||||
expression: backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│ [38;5;10m? [1m[39mmessage[22m [38;5;8m(default)[39m [38;5;0m[48;5;7m [39m[49m │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: src/question/input.rs
|
||||
expression: backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│ [38;5;10m? [1m[39mmessage[22m [38;5;8m(default)[39m inputinputinputinputinput│
|
||||
│inputinputinputinputinput[38;5;0m[48;5;7m [39m[49m │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: src/question/input.rs
|
||||
expression: backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│ [38;5;10m? [1m[39mmessage[22m [38;5;8m›[39m [38;5;0m[48;5;7m [39m[49m │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: src/question/input.rs
|
||||
expression: backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│ [38;5;10m? [1m[39mmessage[22m [38;5;8m›[39m inputinputinputinputinputinputinp│
|
||||
│utinputinputinput[38;5;0m[48;5;7m [39m[49m │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
27
crossterm-snapshots/input__helpers__auto_complete-10.snap
Normal file
27
crossterm-snapshots/input__helpers__auto_complete-10.snap
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: tests/helpers/mod.rs
|
||||
expression: self.backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│[38;5;10m✔[39m [1mmessage[22m [38;5;8m·[39m [38;5;6mstring[39m │
|
||||
│[38;5;0m[48;5;7m [39m[49m │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
27
crossterm-snapshots/input__helpers__auto_complete-2.snap
Normal file
27
crossterm-snapshots/input__helpers__auto_complete-2.snap
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: tests/helpers/mod.rs
|
||||
expression: self.backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│[38;5;10m? [1m[39mmessage[22m [38;5;8m›[39m s[38;5;0m[48;5;7m [39m[49m │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
27
crossterm-snapshots/input__helpers__auto_complete-3.snap
Normal file
27
crossterm-snapshots/input__helpers__auto_complete-3.snap
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: tests/helpers/mod.rs
|
||||
expression: self.backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│[38;5;10m? [1m[39mmessage[22m [38;5;8m›[39m st[38;5;0m[48;5;7m [39m[49m │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
27
crossterm-snapshots/input__helpers__auto_complete-4.snap
Normal file
27
crossterm-snapshots/input__helpers__auto_complete-4.snap
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: tests/helpers/mod.rs
|
||||
expression: self.backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│[38;5;10m? [1m[39mmessage[22m [38;5;8m›[39m str[38;5;0m[48;5;7m [39m[49m │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
27
crossterm-snapshots/input__helpers__auto_complete-5.snap
Normal file
27
crossterm-snapshots/input__helpers__auto_complete-5.snap
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: tests/helpers/mod.rs
|
||||
expression: self.backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│[38;5;10m? [1m[39mmessage[22m [38;5;8m›[39m strg[38;5;0m[48;5;7m [39m[49m │
|
||||
│[38;5;6m❯ strg[39m │
|
||||
│ strh │
|
||||
│ stri │
|
||||
│ strj │
|
||||
│ strk │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
27
crossterm-snapshots/input__helpers__auto_complete-6.snap
Normal file
27
crossterm-snapshots/input__helpers__auto_complete-6.snap
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: tests/helpers/mod.rs
|
||||
expression: self.backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│[38;5;10m? [1m[39mmessage[22m [38;5;8m›[39m strh[38;5;0m[48;5;7m [39m[49m │
|
||||
│ strg │
|
||||
│[38;5;6m❯ strh[39m │
|
||||
│ stri │
|
||||
│ strj │
|
||||
│ strk │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
27
crossterm-snapshots/input__helpers__auto_complete-7.snap
Normal file
27
crossterm-snapshots/input__helpers__auto_complete-7.snap
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: tests/helpers/mod.rs
|
||||
expression: self.backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│[38;5;10m? [1m[39mmessage[22m [38;5;8m›[39m stri[38;5;0m[48;5;7m [39m[49m │
|
||||
│ strg │
|
||||
│ strh │
|
||||
│[38;5;6m❯ stri[39m │
|
||||
│ strj │
|
||||
│ strk │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
27
crossterm-snapshots/input__helpers__auto_complete-8.snap
Normal file
27
crossterm-snapshots/input__helpers__auto_complete-8.snap
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: tests/helpers/mod.rs
|
||||
expression: self.backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│[38;5;10m? [1m[39mmessage[22m [38;5;8m›[39m strin[38;5;0m[48;5;7m [39m[49m │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
27
crossterm-snapshots/input__helpers__auto_complete-9.snap
Normal file
27
crossterm-snapshots/input__helpers__auto_complete-9.snap
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: tests/helpers/mod.rs
|
||||
expression: self.backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│[38;5;10m? [1m[39mmessage[22m [38;5;8m›[39m string[38;5;0m[48;5;7m [39m[49m │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
27
crossterm-snapshots/input__helpers__auto_complete.snap
Normal file
27
crossterm-snapshots/input__helpers__auto_complete.snap
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: tests/helpers/mod.rs
|
||||
expression: self.backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│[38;5;10m? [1m[39mmessage[22m [38;5;8m›[39m [38;5;0m[48;5;7m [39m[49m │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
27
crossterm-snapshots/input__helpers__default-2.snap
Normal file
27
crossterm-snapshots/input__helpers__default-2.snap
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: tests/helpers/mod.rs
|
||||
expression: self.backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│[38;5;10m? [1m[39mmessage[22m [38;5;8m(default)[39m s[38;5;0m[48;5;7m [39m[49m │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
27
crossterm-snapshots/input__helpers__default-3.snap
Normal file
27
crossterm-snapshots/input__helpers__default-3.snap
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: tests/helpers/mod.rs
|
||||
expression: self.backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│[38;5;10m? [1m[39mmessage[22m [38;5;8m(default)[39m [38;5;0m[48;5;7m [39m[49m │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
27
crossterm-snapshots/input__helpers__default-4.snap
Normal file
27
crossterm-snapshots/input__helpers__default-4.snap
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: tests/helpers/mod.rs
|
||||
expression: self.backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│[38;5;10m✔[39m [1mmessage[22m [38;5;8m·[39m │
|
||||
│[38;5;0m[48;5;7m [39m[49m │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
27
crossterm-snapshots/input__helpers__default-5.snap
Normal file
27
crossterm-snapshots/input__helpers__default-5.snap
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: tests/helpers/mod.rs
|
||||
expression: self.backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│[38;5;10m? [1m[39mmessage[22m [38;5;8m(default)[39m [38;5;0m[48;5;7m [39m[49m │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
27
crossterm-snapshots/input__helpers__default-6.snap
Normal file
27
crossterm-snapshots/input__helpers__default-6.snap
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: tests/helpers/mod.rs
|
||||
expression: self.backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│[38;5;10m✔[39m [1mmessage[22m [38;5;8m·[39m [38;5;6mdefault[39m │
|
||||
│[38;5;0m[48;5;7m [39m[49m │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
27
crossterm-snapshots/input__helpers__default.snap
Normal file
27
crossterm-snapshots/input__helpers__default.snap
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: tests/helpers/mod.rs
|
||||
expression: self.backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│[38;5;10m? [1m[39mmessage[22m [38;5;8m(default)[39m [38;5;0m[48;5;7m [39m[49m │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
27
crossterm-snapshots/input__helpers__filter-2.snap
Normal file
27
crossterm-snapshots/input__helpers__filter-2.snap
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: tests/helpers/mod.rs
|
||||
expression: self.backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│[38;5;10m? [1m[39mmessage[22m [38;5;8m›[39m s[38;5;0m[48;5;7m [39m[49m │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
27
crossterm-snapshots/input__helpers__filter-3.snap
Normal file
27
crossterm-snapshots/input__helpers__filter-3.snap
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: tests/helpers/mod.rs
|
||||
expression: self.backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│[38;5;10m? [1m[39mmessage[22m [38;5;8m›[39m st[38;5;0m[48;5;7m [39m[49m │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
27
crossterm-snapshots/input__helpers__filter-4.snap
Normal file
27
crossterm-snapshots/input__helpers__filter-4.snap
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: tests/helpers/mod.rs
|
||||
expression: self.backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│[38;5;10m? [1m[39mmessage[22m [38;5;8m›[39m str[38;5;0m[48;5;7m [39m[49m │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
27
crossterm-snapshots/input__helpers__filter-5.snap
Normal file
27
crossterm-snapshots/input__helpers__filter-5.snap
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: tests/helpers/mod.rs
|
||||
expression: self.backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│[38;5;10m✔[39m [1mmessage[22m [38;5;8m·[39m [38;5;6mstr--suffix[39m │
|
||||
│[38;5;0m[48;5;7m [39m[49m │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
27
crossterm-snapshots/input__helpers__filter.snap
Normal file
27
crossterm-snapshots/input__helpers__filter.snap
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: tests/helpers/mod.rs
|
||||
expression: self.backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│[38;5;10m? [1m[39mmessage[22m [38;5;8m›[39m [38;5;0m[48;5;7m [39m[49m │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
27
crossterm-snapshots/input__helpers__transform-2.snap
Normal file
27
crossterm-snapshots/input__helpers__transform-2.snap
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: tests/helpers/mod.rs
|
||||
expression: self.backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│[38;5;10m? [1m[39mmessage[22m [38;5;8m›[39m s[38;5;0m[48;5;7m [39m[49m │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
27
crossterm-snapshots/input__helpers__transform-3.snap
Normal file
27
crossterm-snapshots/input__helpers__transform-3.snap
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: tests/helpers/mod.rs
|
||||
expression: self.backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│[38;5;10m? [1m[39mmessage[22m [38;5;8m›[39m st[38;5;0m[48;5;7m [39m[49m │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
27
crossterm-snapshots/input__helpers__transform-4.snap
Normal file
27
crossterm-snapshots/input__helpers__transform-4.snap
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: tests/helpers/mod.rs
|
||||
expression: self.backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│[38;5;10m? [1m[39mmessage[22m [38;5;8m›[39m str[38;5;0m[48;5;7m [39m[49m │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
27
crossterm-snapshots/input__helpers__transform-5.snap
Normal file
27
crossterm-snapshots/input__helpers__transform-5.snap
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: tests/helpers/mod.rs
|
||||
expression: self.backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│[38;5;10m✔[39m [1mmessage[22m [38;5;8m·[39m [38;5;5m"str"[39m │
|
||||
│[38;5;0m[48;5;7m [39m[49m │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
27
crossterm-snapshots/input__helpers__transform.snap
Normal file
27
crossterm-snapshots/input__helpers__transform.snap
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: tests/helpers/mod.rs
|
||||
expression: self.backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│[38;5;10m? [1m[39mmessage[22m [38;5;8m›[39m [38;5;0m[48;5;7m [39m[49m │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
27
crossterm-snapshots/input__helpers__validate-2.snap
Normal file
27
crossterm-snapshots/input__helpers__validate-2.snap
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: tests/helpers/mod.rs
|
||||
expression: self.backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│[38;5;10m? [1m[39mmessage[22m [38;5;8m›[39m t[38;5;0m[48;5;7m [39m[49m │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
27
crossterm-snapshots/input__helpers__validate-3.snap
Normal file
27
crossterm-snapshots/input__helpers__validate-3.snap
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: tests/helpers/mod.rs
|
||||
expression: self.backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│[38;5;10m? [1m[39mmessage[22m [38;5;8m›[39m tr[38;5;0m[48;5;7m [39m[49m │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
27
crossterm-snapshots/input__helpers__validate-4.snap
Normal file
27
crossterm-snapshots/input__helpers__validate-4.snap
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: tests/helpers/mod.rs
|
||||
expression: self.backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│[38;5;10m? [1m[39mmessage[22m [38;5;8m›[39m tr[38;5;0m[48;5;7m [39m[49m │
|
||||
│[38;5;1m✖[39m The string must be more than 2 characters long │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
27
crossterm-snapshots/input__helpers__validate-5.snap
Normal file
27
crossterm-snapshots/input__helpers__validate-5.snap
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: tests/helpers/mod.rs
|
||||
expression: self.backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│[38;5;10m? [1m[39mmessage[22m [38;5;8m›[39m [38;5;0m[48;5;7mt[39m[49mr │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
27
crossterm-snapshots/input__helpers__validate-6.snap
Normal file
27
crossterm-snapshots/input__helpers__validate-6.snap
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: tests/helpers/mod.rs
|
||||
expression: self.backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│[38;5;10m? [1m[39mmessage[22m [38;5;8m›[39m s[38;5;0m[48;5;7mt[39m[49mr │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
27
crossterm-snapshots/input__helpers__validate-7.snap
Normal file
27
crossterm-snapshots/input__helpers__validate-7.snap
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: tests/helpers/mod.rs
|
||||
expression: self.backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│[38;5;10m✔[39m [1mmessage[22m [38;5;8m·[39m [38;5;6mstr[39m │
|
||||
│[38;5;0m[48;5;7m [39m[49m │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
27
crossterm-snapshots/input__helpers__validate.snap
Normal file
27
crossterm-snapshots/input__helpers__validate.snap
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: tests/helpers/mod.rs
|
||||
expression: self.backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│[38;5;10m? [1m[39mmessage[22m [38;5;8m›[39m [38;5;0m[48;5;7m [39m[49m │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
|
@ -171,7 +171,21 @@ impl Prompt for InputPrompt<'_, '_> {
|
|||
}
|
||||
}
|
||||
|
||||
impl Input<'_> {
|
||||
impl<'i> Input<'i> {
|
||||
fn into_input_prompt<'a>(
|
||||
mut self,
|
||||
message: &'a str,
|
||||
answers: &'a Answers,
|
||||
) -> InputPrompt<'i, 'a> {
|
||||
InputPrompt {
|
||||
prompt: widgets::Prompt::new(message).with_optional_hint(self.default.take()),
|
||||
input_opts: self,
|
||||
input: widgets::StringInput::default(),
|
||||
select: None,
|
||||
answers,
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn ask<B: Backend, E: Iterator<Item = error::Result<KeyEvent>>>(
|
||||
mut self,
|
||||
message: String,
|
||||
|
@ -181,17 +195,7 @@ impl Input<'_> {
|
|||
) -> error::Result<Answer> {
|
||||
let transform = self.transform.take();
|
||||
|
||||
let ans = ui::Input::new(
|
||||
InputPrompt {
|
||||
prompt: widgets::Prompt::new(&message[..]).with_optional_hint(self.default.take()),
|
||||
input_opts: self,
|
||||
input: widgets::StringInput::default(),
|
||||
select: None,
|
||||
answers,
|
||||
},
|
||||
b,
|
||||
)
|
||||
.run(events)?;
|
||||
let ans = ui::Input::new(self.into_input_prompt(&message, answers), b).run(events)?;
|
||||
|
||||
crate::write_final!(
|
||||
transform,
|
||||
|
@ -240,3 +244,189 @@ impl<'a> From<InputBuilder<'a>> for super::Question<'a> {
|
|||
builder.build()
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use ui::{backend::TestBackend, layout::Layout};
|
||||
|
||||
use super::*;
|
||||
|
||||
const NINPUTS: usize = 3;
|
||||
static INPUT_IDS: [&str; NINPUTS] = ["no_default", "default", "auto_complete"];
|
||||
const AUTO_COMPLETE_IDX: usize = 2;
|
||||
|
||||
fn inputs(answers: &Answers) -> [(InputPrompt<'static, '_>, u16); NINPUTS] {
|
||||
[
|
||||
(Input::default().into_input_prompt("message", &answers), 17),
|
||||
(
|
||||
Input {
|
||||
default: Some("default".into()),
|
||||
..Input::default()
|
||||
}
|
||||
.into_input_prompt("message", &answers),
|
||||
25,
|
||||
),
|
||||
(
|
||||
Input {
|
||||
auto_complete: AutoComplete::Sync(Box::new(|s, _| {
|
||||
let mut completions: Vec<_> = ('a'..='d')
|
||||
.map(|c| {
|
||||
let mut s = s.clone();
|
||||
s.push(c);
|
||||
s
|
||||
})
|
||||
.collect();
|
||||
completions.push(s + "e");
|
||||
completions
|
||||
})),
|
||||
..Input::default()
|
||||
}
|
||||
.into_input_prompt("message", &answers),
|
||||
17,
|
||||
),
|
||||
]
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_render() {
|
||||
let size = (50, 20).into();
|
||||
let base_layout = Layout::new(5, size);
|
||||
let answers = Answers::default();
|
||||
|
||||
let mut inputs = inputs(&answers);
|
||||
let mut backend = TestBackend::new_with_layout(size, base_layout);
|
||||
|
||||
for (i, (prompt, line_offset)) in inputs.iter_mut().enumerate() {
|
||||
let line_offset = *line_offset;
|
||||
|
||||
let mut layout = base_layout;
|
||||
backend.reset_with_layout(layout);
|
||||
assert!(prompt.render(&mut layout, &mut backend).is_ok());
|
||||
assert_eq!(layout, base_layout.with_line_offset(line_offset));
|
||||
ui::assert_backend_snapshot!(format!("{}-1", INPUT_IDS[i]), backend);
|
||||
|
||||
prompt.input.set_value("input".repeat(10));
|
||||
|
||||
layout = base_layout;
|
||||
backend.reset_with_layout(layout);
|
||||
assert!(prompt.render(&mut layout, &mut backend).is_ok());
|
||||
assert_eq!(
|
||||
layout,
|
||||
base_layout.with_offset(0, 1).with_line_offset(line_offset)
|
||||
);
|
||||
ui::assert_backend_snapshot!(format!("{}-2", INPUT_IDS[i]), backend);
|
||||
}
|
||||
|
||||
let prompt = &mut inputs[AUTO_COMPLETE_IDX].0;
|
||||
|
||||
prompt.input.replace_with(|mut s| {
|
||||
s.truncate(5);
|
||||
s
|
||||
});
|
||||
assert!(prompt.handle_key(KeyCode::Tab.into()));
|
||||
|
||||
let mut layout = base_layout;
|
||||
backend.reset_with_layout(layout);
|
||||
assert!(prompt.render(&mut layout, &mut backend).is_ok());
|
||||
assert_eq!(layout, base_layout.with_offset(0, 6).with_line_offset(0));
|
||||
ui::assert_backend_snapshot!(format!("{}-3", INPUT_IDS[AUTO_COMPLETE_IDX]), backend);
|
||||
|
||||
assert!(prompt.handle_key(KeyCode::Tab.into()));
|
||||
assert_eq!(prompt.validate(), Ok(Validation::Continue));
|
||||
|
||||
layout = base_layout;
|
||||
backend.reset_with_layout(layout);
|
||||
assert!(prompt.render(&mut layout, &mut backend).is_ok());
|
||||
assert_eq!(
|
||||
layout,
|
||||
base_layout
|
||||
.with_offset(0, 0)
|
||||
.with_line_offset(inputs[AUTO_COMPLETE_IDX].1 + 6)
|
||||
);
|
||||
ui::assert_backend_snapshot!(format!("{}-4", INPUT_IDS[AUTO_COMPLETE_IDX]), backend);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_height() {
|
||||
let size = (50, 20).into();
|
||||
let base_layout = Layout::new(5, size);
|
||||
let answers = Answers::default();
|
||||
|
||||
let mut inputs = inputs(&answers);
|
||||
|
||||
for (prompt, line_offset) in inputs.iter_mut() {
|
||||
let line_offset = *line_offset;
|
||||
|
||||
let mut layout = base_layout;
|
||||
assert_eq!(prompt.height(&mut layout), 1);
|
||||
assert_eq!(layout, base_layout.with_line_offset(line_offset));
|
||||
|
||||
prompt.input.set_value("input".repeat(10));
|
||||
|
||||
layout = base_layout;
|
||||
assert_eq!(prompt.height(&mut layout), 2);
|
||||
assert_eq!(
|
||||
layout,
|
||||
base_layout.with_offset(0, 1).with_line_offset(line_offset)
|
||||
);
|
||||
}
|
||||
|
||||
let prompt = &mut inputs[AUTO_COMPLETE_IDX].0;
|
||||
|
||||
prompt.input.replace_with(|mut s| {
|
||||
s.truncate(5);
|
||||
s
|
||||
});
|
||||
assert!(prompt.handle_key(KeyCode::Tab.into()));
|
||||
|
||||
let mut layout = base_layout;
|
||||
assert_eq!(prompt.height(&mut layout), 6);
|
||||
assert_eq!(layout, base_layout.with_offset(0, 6).with_line_offset(0));
|
||||
|
||||
assert!(prompt.handle_key(KeyCode::Tab.into()));
|
||||
assert_eq!(prompt.validate(), Ok(Validation::Continue));
|
||||
|
||||
layout = base_layout;
|
||||
assert_eq!(prompt.height(&mut layout), 1);
|
||||
assert_eq!(
|
||||
layout,
|
||||
base_layout
|
||||
.with_offset(0, 0)
|
||||
.with_line_offset(inputs[AUTO_COMPLETE_IDX].1 + 6)
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_cursor_pos() {
|
||||
let size = (50, 20).into();
|
||||
let layout = Layout::new(5, size);
|
||||
let answers = Answers::default();
|
||||
|
||||
let mut inputs = inputs(&answers);
|
||||
|
||||
for (prompt, line_offset) in inputs.iter_mut() {
|
||||
let line_offset = *line_offset;
|
||||
|
||||
assert_eq!(prompt.cursor_pos(layout), (line_offset, 0));
|
||||
prompt.input.set_value("input".repeat(10));
|
||||
prompt.input.set_at(50);
|
||||
assert_eq!(prompt.cursor_pos(layout), (line_offset, 1));
|
||||
}
|
||||
|
||||
let prompt = &mut inputs[AUTO_COMPLETE_IDX].0;
|
||||
let line_offset = inputs[AUTO_COMPLETE_IDX].1;
|
||||
|
||||
prompt.input.replace_with(|mut s| {
|
||||
s.truncate(5);
|
||||
s
|
||||
});
|
||||
assert!(prompt.handle_key(KeyCode::Tab.into()));
|
||||
|
||||
assert_eq!(prompt.cursor_pos(layout), (line_offset + 6, 0));
|
||||
|
||||
assert!(prompt.handle_key(KeyCode::Tab.into()));
|
||||
assert_eq!(prompt.validate(), Ok(Validation::Continue));
|
||||
|
||||
assert_eq!(prompt.cursor_pos(layout), (line_offset + 6, 0));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: src/question/input.rs
|
||||
expression: backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│ [38;5;10m? [1m[39mmessage[22m [38;5;8m›[39m [38;5;0m[48;5;7m [39m[49m │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: src/question/input.rs
|
||||
expression: backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│ [38;5;10m? [1m[39mmessage[22m [38;5;8m›[39m inputinputinputinputinputinputinp│
|
||||
│utinputinputinput[38;5;0m[48;5;7m [39m[49m │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: src/question/input.rs
|
||||
expression: backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│ [38;5;10m? [1m[39mmessage[22m [38;5;8m›[39m inputa │
|
||||
│[38;5;6m❯ inputa[39m │
|
||||
│ inputb │
|
||||
│ inputc │
|
||||
│ inputd │
|
||||
│ inpute │
|
||||
│[38;5;0m[48;5;7m [39m[49m │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: src/question/input.rs
|
||||
expression: backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│ [38;5;10m? [1m[39mmessage[22m [38;5;8m›[39m inputb[38;5;0m[48;5;7m [39m[49m │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: src/question/input.rs
|
||||
expression: backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│ [38;5;10m? [1m[39mmessage[22m [38;5;8m(default)[39m [38;5;0m[48;5;7m [39m[49m │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: src/question/input.rs
|
||||
expression: backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│ [38;5;10m? [1m[39mmessage[22m [38;5;8m(default)[39m inputinputinputinputinput│
|
||||
│inputinputinputinputinput[38;5;0m[48;5;7m [39m[49m │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: src/question/input.rs
|
||||
expression: backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│ [38;5;10m? [1m[39mmessage[22m [38;5;8m›[39m [38;5;0m[48;5;7m [39m[49m │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: src/question/input.rs
|
||||
expression: backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│ [38;5;10m? [1m[39mmessage[22m [38;5;8m›[39m inputinputinputinputinputinputinp│
|
||||
│utinputinputinput[38;5;0m[48;5;7m [39m[49m │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
27
termion-snapshots/input__helpers__auto_complete-10.snap
Normal file
27
termion-snapshots/input__helpers__auto_complete-10.snap
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: tests/helpers/mod.rs
|
||||
expression: self.backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│[38;5;10m✔[39m [1mmessage[22m [38;5;8m·[39m [38;5;6mstring[39m │
|
||||
│[38;5;0m[48;5;7m [39m[49m │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
27
termion-snapshots/input__helpers__auto_complete-2.snap
Normal file
27
termion-snapshots/input__helpers__auto_complete-2.snap
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: tests/helpers/mod.rs
|
||||
expression: self.backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│[38;5;10m? [1m[39mmessage[22m [38;5;8m›[39m s[38;5;0m[48;5;7m [39m[49m │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
27
termion-snapshots/input__helpers__auto_complete-3.snap
Normal file
27
termion-snapshots/input__helpers__auto_complete-3.snap
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: tests/helpers/mod.rs
|
||||
expression: self.backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│[38;5;10m? [1m[39mmessage[22m [38;5;8m›[39m st[38;5;0m[48;5;7m [39m[49m │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
27
termion-snapshots/input__helpers__auto_complete-4.snap
Normal file
27
termion-snapshots/input__helpers__auto_complete-4.snap
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: tests/helpers/mod.rs
|
||||
expression: self.backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│[38;5;10m? [1m[39mmessage[22m [38;5;8m›[39m str[38;5;0m[48;5;7m [39m[49m │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
27
termion-snapshots/input__helpers__auto_complete-5.snap
Normal file
27
termion-snapshots/input__helpers__auto_complete-5.snap
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: tests/helpers/mod.rs
|
||||
expression: self.backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│[38;5;10m? [1m[39mmessage[22m [38;5;8m›[39m strg[38;5;0m[48;5;7m [39m[49m │
|
||||
│[38;5;6m❯ strg[39m │
|
||||
│ strh │
|
||||
│ stri │
|
||||
│ strj │
|
||||
│ strk │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
27
termion-snapshots/input__helpers__auto_complete-6.snap
Normal file
27
termion-snapshots/input__helpers__auto_complete-6.snap
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: tests/helpers/mod.rs
|
||||
expression: self.backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│[38;5;10m? [1m[39mmessage[22m [38;5;8m›[39m strh[38;5;0m[48;5;7m [39m[49m │
|
||||
│ strg │
|
||||
│[38;5;6m❯ strh[39m │
|
||||
│ stri │
|
||||
│ strj │
|
||||
│ strk │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
27
termion-snapshots/input__helpers__auto_complete-7.snap
Normal file
27
termion-snapshots/input__helpers__auto_complete-7.snap
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: tests/helpers/mod.rs
|
||||
expression: self.backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│[38;5;10m? [1m[39mmessage[22m [38;5;8m›[39m stri[38;5;0m[48;5;7m [39m[49m │
|
||||
│ strg │
|
||||
│ strh │
|
||||
│[38;5;6m❯ stri[39m │
|
||||
│ strj │
|
||||
│ strk │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
27
termion-snapshots/input__helpers__auto_complete-8.snap
Normal file
27
termion-snapshots/input__helpers__auto_complete-8.snap
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: tests/helpers/mod.rs
|
||||
expression: self.backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│[38;5;10m? [1m[39mmessage[22m [38;5;8m›[39m strin[38;5;0m[48;5;7m [39m[49m │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
27
termion-snapshots/input__helpers__auto_complete-9.snap
Normal file
27
termion-snapshots/input__helpers__auto_complete-9.snap
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: tests/helpers/mod.rs
|
||||
expression: self.backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│[38;5;10m? [1m[39mmessage[22m [38;5;8m›[39m string[38;5;0m[48;5;7m [39m[49m │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
27
termion-snapshots/input__helpers__auto_complete.snap
Normal file
27
termion-snapshots/input__helpers__auto_complete.snap
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: tests/helpers/mod.rs
|
||||
expression: self.backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│[38;5;10m? [1m[39mmessage[22m [38;5;8m›[39m [38;5;0m[48;5;7m [39m[49m │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
27
termion-snapshots/input__helpers__default-2.snap
Normal file
27
termion-snapshots/input__helpers__default-2.snap
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: tests/helpers/mod.rs
|
||||
expression: self.backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│[38;5;10m? [1m[39mmessage[22m [38;5;8m(default)[39m s[38;5;0m[48;5;7m [39m[49m │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
27
termion-snapshots/input__helpers__default-3.snap
Normal file
27
termion-snapshots/input__helpers__default-3.snap
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: tests/helpers/mod.rs
|
||||
expression: self.backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│[38;5;10m? [1m[39mmessage[22m [38;5;8m(default)[39m [38;5;0m[48;5;7m [39m[49m │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
27
termion-snapshots/input__helpers__default-4.snap
Normal file
27
termion-snapshots/input__helpers__default-4.snap
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: tests/helpers/mod.rs
|
||||
expression: self.backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│[38;5;10m✔[39m [1mmessage[22m [38;5;8m·[39m │
|
||||
│[38;5;0m[48;5;7m [39m[49m │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
27
termion-snapshots/input__helpers__default-5.snap
Normal file
27
termion-snapshots/input__helpers__default-5.snap
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: tests/helpers/mod.rs
|
||||
expression: self.backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│[38;5;10m? [1m[39mmessage[22m [38;5;8m(default)[39m [38;5;0m[48;5;7m [39m[49m │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
27
termion-snapshots/input__helpers__default-6.snap
Normal file
27
termion-snapshots/input__helpers__default-6.snap
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: tests/helpers/mod.rs
|
||||
expression: self.backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│[38;5;10m✔[39m [1mmessage[22m [38;5;8m·[39m [38;5;6mdefault[39m │
|
||||
│[38;5;0m[48;5;7m [39m[49m │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
27
termion-snapshots/input__helpers__default.snap
Normal file
27
termion-snapshots/input__helpers__default.snap
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: tests/helpers/mod.rs
|
||||
expression: self.backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│[38;5;10m? [1m[39mmessage[22m [38;5;8m(default)[39m [38;5;0m[48;5;7m [39m[49m │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
27
termion-snapshots/input__helpers__filter-2.snap
Normal file
27
termion-snapshots/input__helpers__filter-2.snap
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: tests/helpers/mod.rs
|
||||
expression: self.backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│[38;5;10m? [1m[39mmessage[22m [38;5;8m›[39m s[38;5;0m[48;5;7m [39m[49m │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
27
termion-snapshots/input__helpers__filter-3.snap
Normal file
27
termion-snapshots/input__helpers__filter-3.snap
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: tests/helpers/mod.rs
|
||||
expression: self.backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│[38;5;10m? [1m[39mmessage[22m [38;5;8m›[39m st[38;5;0m[48;5;7m [39m[49m │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
27
termion-snapshots/input__helpers__filter-4.snap
Normal file
27
termion-snapshots/input__helpers__filter-4.snap
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: tests/helpers/mod.rs
|
||||
expression: self.backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│[38;5;10m? [1m[39mmessage[22m [38;5;8m›[39m str[38;5;0m[48;5;7m [39m[49m │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
27
termion-snapshots/input__helpers__filter-5.snap
Normal file
27
termion-snapshots/input__helpers__filter-5.snap
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: tests/helpers/mod.rs
|
||||
expression: self.backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│[38;5;10m✔[39m [1mmessage[22m [38;5;8m·[39m [38;5;6mstr--suffix[39m │
|
||||
│[38;5;0m[48;5;7m [39m[49m │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
27
termion-snapshots/input__helpers__filter.snap
Normal file
27
termion-snapshots/input__helpers__filter.snap
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: tests/helpers/mod.rs
|
||||
expression: self.backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│[38;5;10m? [1m[39mmessage[22m [38;5;8m›[39m [38;5;0m[48;5;7m [39m[49m │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
27
termion-snapshots/input__helpers__transform-2.snap
Normal file
27
termion-snapshots/input__helpers__transform-2.snap
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: tests/helpers/mod.rs
|
||||
expression: self.backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│[38;5;10m? [1m[39mmessage[22m [38;5;8m›[39m s[38;5;0m[48;5;7m [39m[49m │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
27
termion-snapshots/input__helpers__transform-3.snap
Normal file
27
termion-snapshots/input__helpers__transform-3.snap
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: tests/helpers/mod.rs
|
||||
expression: self.backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│[38;5;10m? [1m[39mmessage[22m [38;5;8m›[39m st[38;5;0m[48;5;7m [39m[49m │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
27
termion-snapshots/input__helpers__transform-4.snap
Normal file
27
termion-snapshots/input__helpers__transform-4.snap
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: tests/helpers/mod.rs
|
||||
expression: self.backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│[38;5;10m? [1m[39mmessage[22m [38;5;8m›[39m str[38;5;0m[48;5;7m [39m[49m │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
27
termion-snapshots/input__helpers__transform-5.snap
Normal file
27
termion-snapshots/input__helpers__transform-5.snap
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: tests/helpers/mod.rs
|
||||
expression: self.backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│[38;5;10m✔[39m [1mmessage[22m [38;5;8m·[39m [38;5;5m"str"[39m │
|
||||
│[38;5;0m[48;5;7m [39m[49m │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
27
termion-snapshots/input__helpers__transform.snap
Normal file
27
termion-snapshots/input__helpers__transform.snap
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: tests/helpers/mod.rs
|
||||
expression: self.backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│[38;5;10m? [1m[39mmessage[22m [38;5;8m›[39m [38;5;0m[48;5;7m [39m[49m │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
27
termion-snapshots/input__helpers__validate-2.snap
Normal file
27
termion-snapshots/input__helpers__validate-2.snap
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: tests/helpers/mod.rs
|
||||
expression: self.backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│[38;5;10m? [1m[39mmessage[22m [38;5;8m›[39m t[38;5;0m[48;5;7m [39m[49m │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
27
termion-snapshots/input__helpers__validate-3.snap
Normal file
27
termion-snapshots/input__helpers__validate-3.snap
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: tests/helpers/mod.rs
|
||||
expression: self.backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│[38;5;10m? [1m[39mmessage[22m [38;5;8m›[39m tr[38;5;0m[48;5;7m [39m[49m │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
27
termion-snapshots/input__helpers__validate-4.snap
Normal file
27
termion-snapshots/input__helpers__validate-4.snap
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: tests/helpers/mod.rs
|
||||
expression: self.backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│[38;5;10m? [1m[39mmessage[22m [38;5;8m›[39m tr[38;5;0m[48;5;7m [39m[49m │
|
||||
│[38;5;1m✖[39m The string must be more than 2 characters long │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
27
termion-snapshots/input__helpers__validate-5.snap
Normal file
27
termion-snapshots/input__helpers__validate-5.snap
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: tests/helpers/mod.rs
|
||||
expression: self.backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│[38;5;10m? [1m[39mmessage[22m [38;5;8m›[39m [38;5;0m[48;5;7mt[39m[49mr │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
27
termion-snapshots/input__helpers__validate-6.snap
Normal file
27
termion-snapshots/input__helpers__validate-6.snap
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: tests/helpers/mod.rs
|
||||
expression: self.backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│[38;5;10m? [1m[39mmessage[22m [38;5;8m›[39m s[38;5;0m[48;5;7mt[39m[49mr │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
27
termion-snapshots/input__helpers__validate-7.snap
Normal file
27
termion-snapshots/input__helpers__validate-7.snap
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: tests/helpers/mod.rs
|
||||
expression: self.backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│[38;5;10m✔[39m [1mmessage[22m [38;5;8m·[39m [38;5;6mstr[39m │
|
||||
│[38;5;0m[48;5;7m [39m[49m │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
27
termion-snapshots/input__helpers__validate.snap
Normal file
27
termion-snapshots/input__helpers__validate.snap
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
source: tests/helpers/mod.rs
|
||||
expression: self.backend
|
||||
|
||||
---
|
||||
┌──────────────────────────────────────────────────┐
|
||||
│[38;5;10m? [1m[39mmessage[22m [38;5;8m›[39m [38;5;0m[48;5;7m [39m[49m │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└──────────────────────────────────────────────────┘
|
137
tests/input.rs
Normal file
137
tests/input.rs
Normal file
|
@ -0,0 +1,137 @@
|
|||
use discourse::{Answer, Question};
|
||||
use ui::{
|
||||
events::{KeyCode, TestEvents},
|
||||
style::Color,
|
||||
};
|
||||
|
||||
mod helpers;
|
||||
|
||||
#[test]
|
||||
fn test_validate() {
|
||||
let prompt = Question::input("name").message("message").validate(|s, _| {
|
||||
if s.len() > 2 {
|
||||
Ok(())
|
||||
} else {
|
||||
Err("The string must be more than 2 characters long".into())
|
||||
}
|
||||
});
|
||||
|
||||
let mut backend = helpers::SnapshotOnFlushBackend::new((50, 20).into());
|
||||
let mut events = TestEvents::new(vec![
|
||||
KeyCode::Char('t').into(),
|
||||
KeyCode::Char('r').into(),
|
||||
KeyCode::Enter.into(),
|
||||
KeyCode::Home.into(),
|
||||
KeyCode::Char('s').into(),
|
||||
KeyCode::Enter.into(),
|
||||
]);
|
||||
|
||||
let ans = discourse::prompt_one_with(prompt, &mut backend, &mut events).unwrap();
|
||||
assert_eq!(ans, Answer::String("str".into()));
|
||||
assert!(events.next().is_none());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_filter() {
|
||||
let prompt = Question::input("name")
|
||||
.message("message")
|
||||
.filter(|s, _| s + "--suffix");
|
||||
|
||||
let mut backend = helpers::SnapshotOnFlushBackend::new((50, 20).into());
|
||||
let mut events = TestEvents::new(vec![
|
||||
KeyCode::Char('s').into(),
|
||||
KeyCode::Char('t').into(),
|
||||
KeyCode::Char('r').into(),
|
||||
KeyCode::Enter.into(),
|
||||
]);
|
||||
|
||||
let ans = discourse::prompt_one_with(prompt, &mut backend, &mut events).unwrap();
|
||||
assert_eq!(ans, Answer::String("str--suffix".into()));
|
||||
assert!(events.next().is_none());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_transform() {
|
||||
let prompt = Question::input("name")
|
||||
.message("message")
|
||||
.transform(|s, _, b| {
|
||||
b.set_fg(Color::Magenta)?;
|
||||
write!(b, "{:?}", s)?;
|
||||
b.set_fg(Color::Reset)
|
||||
});
|
||||
|
||||
let mut backend = helpers::SnapshotOnFlushBackend::new((50, 20).into());
|
||||
let mut events = TestEvents::new(vec![
|
||||
KeyCode::Char('s').into(),
|
||||
KeyCode::Char('t').into(),
|
||||
KeyCode::Char('r').into(),
|
||||
KeyCode::Enter.into(),
|
||||
]);
|
||||
|
||||
let ans = discourse::prompt_one_with(prompt, &mut backend, &mut events).unwrap();
|
||||
assert_eq!(ans, Answer::String("str".into()));
|
||||
assert!(events.next().is_none());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_default() {
|
||||
let prompt = Question::input("name")
|
||||
.message("message")
|
||||
.default("default");
|
||||
|
||||
let mut backend = helpers::SnapshotOnFlushBackend::new((50, 20).into());
|
||||
let mut events = TestEvents::new(vec![
|
||||
KeyCode::Char('s').into(),
|
||||
KeyCode::Backspace.into(),
|
||||
KeyCode::Enter.into(),
|
||||
]);
|
||||
|
||||
let ans = discourse::prompt_one_with(prompt, &mut backend, &mut events).unwrap();
|
||||
assert_eq!(ans, Answer::String("".into()));
|
||||
assert!(events.next().is_none());
|
||||
|
||||
let prompt = Question::input("name")
|
||||
.message("message")
|
||||
.default("default");
|
||||
|
||||
let mut backend = helpers::SnapshotOnFlushBackend::new((50, 20).into());
|
||||
let mut events = TestEvents::new(Some(KeyCode::Enter.into()));
|
||||
|
||||
let ans = discourse::prompt_one_with(prompt, &mut backend, &mut events).unwrap();
|
||||
assert_eq!(ans, Answer::String("default".into()));
|
||||
assert!(events.next().is_none());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_auto_complete() {
|
||||
let prompt = Question::input("name")
|
||||
.message("message")
|
||||
.auto_complete(|s, _| {
|
||||
let mut completions: Vec<_> = ('g'..='j')
|
||||
.map(|c| {
|
||||
let mut s = s.clone();
|
||||
s.push(c);
|
||||
s
|
||||
})
|
||||
.collect();
|
||||
completions.push(s + "k");
|
||||
completions
|
||||
});
|
||||
|
||||
let mut backend = helpers::SnapshotOnFlushBackend::new((50, 20).into());
|
||||
let mut events = TestEvents::new(vec![
|
||||
KeyCode::Char('s').into(),
|
||||
KeyCode::Char('t').into(),
|
||||
KeyCode::Char('r').into(),
|
||||
KeyCode::Tab.into(),
|
||||
KeyCode::Tab.into(),
|
||||
KeyCode::Tab.into(),
|
||||
KeyCode::Char('n').into(),
|
||||
KeyCode::Char('g').into(),
|
||||
KeyCode::Enter.into(),
|
||||
]);
|
||||
|
||||
let ans = discourse::prompt_one_with(prompt, &mut backend, &mut events).unwrap();
|
||||
assert_eq!(ans, Answer::String("string".into()));
|
||||
assert!(events.next().is_none());
|
||||
}
|
Loading…
Reference in New Issue
Block a user