File: test_search_replace.sh

package info (click to toggle)
mle 1.7.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,108 kB
  • sloc: ansic: 13,335; sh: 728; php: 228; makefile: 83
file content (91 lines) | stat: -rwxr-xr-x 3,023 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#!/usr/bin/env bash

# cmd_search
macro='h e l l o enter w o r l d C-f h e l l o enter'
declare -A expected
expected[search_cursor_line]='^bview.0.cursor.0.mark.line_index=0$'
expected[search_cursor_col ]='^bview.0.cursor.0.mark.col=0$'
source 'test.sh'

# cmd_rsearch
macro='h i enter h i enter h i enter CM-f h i enter'
declare -A expected
expected[rsearch_cursor_line]='^bview.0.cursor.0.mark.line_index=2$'
expected[rsearch_cursor_col ]='^bview.0.cursor.0.mark.col=0$'
source 'test.sh'

# cmd_search_next
macro='h i enter h i enter h i enter C-f h i enter C-g'
declare -A expected
expected[next_cursor_line]='^bview.0.cursor.0.mark.line_index=1$'
expected[next_cursor_col ]='^bview.0.cursor.0.mark.col=0$'
source 'test.sh'

# cmd_search_prev (wrap)
macro='h i enter h i enter h i enter C-f h i enter CM-g'
declare -A expected
expected[prev_wrap_cursor_line]='^bview.0.cursor.0.mark.line_index=2$'
expected[prev_wrap_cursor_col ]='^bview.0.cursor.0.mark.col=0$'
source 'test.sh'

# cmd_search_next (wrap)
macro='h e l l o enter h e l l o C-f h e l l o enter C-g C-g'
declare -A expected
expected[next_wrap_cursor_line]='^bview.0.cursor.0.mark.line_index=0$'
expected[next_wrap_cursor_col ]='^bview.0.cursor.0.mark.col=0$'
source 'test.sh'

# cmd_find_word
macro='h e l l o enter h e l l o left C-v'
declare -A expected
expected[find_cursor_line]='^bview.0.cursor.0.mark.line_index=0$'
expected[find_cursor_col ]='^bview.0.cursor.0.mark.col=0$'
source 'test.sh'

# cmd_find_word (wrap)
macro='h e l l o enter h e l l o left C-v C-v'
declare -A expected
expected[find_wrap_cursor_line]='^bview.0.cursor.0.mark.line_index=1$'
expected[find_wrap_cursor_col ]='^bview.0.cursor.0.mark.col=0$'
source 'test.sh'

# cmd_rfind_word
macro='h i enter h i enter h i C-a CM-v'
declare -A expected
expected[rfind_cursor_line]='^bview.0.cursor.0.mark.line_index=1$'
expected[rfind_cursor_col ]='^bview.0.cursor.0.mark.col=0$'
source 'test.sh'

# cmd_isearch
macro='a c t o r enter a p p l e enter a p p e t i t e enter a z u r e M-\ C-r a p p e enter'
declare -A expected
expected[isearch_cursor_line]='^bview.0.cursor.0.mark.line_index=2$'
expected[iesarch_cursor_col ]='^bview.0.cursor.0.mark.col=0$'
source 'test.sh'

# cmd_replace 1
macro='a 1 space b 2 space c 3 space d 4 C-t \ d + enter x enter y n a'
declare -A expected
expected[replace1_data]='^ax b2 cx dx$'
source 'test.sh'

# cmd_replace 2
macro='a 1 space b 2 space c 3 space d 4 C-t \ d + enter x enter y n C-c'
declare -A expected
expected[replace2_data]='^ax b2 c3 d4$'
source 'test.sh'

# cmd_replace 3
macro='a b c 1 2 3 C-t ( . . . ) ( . . . ) enter A $ 2 $ n B $ 1 $ n $ x 4 3 enter a'
declare -A expected
expected[replace3_data1]='^A123$'
expected[replace3_data2]='^Babc$'
expected[replace3_data3]='^C$'
source 'test.sh'

# cmd_search history
macro='h e l l o enter h e l l o C-f h e l l o enter C-f up enter'
declare -A expected
expected[history_line]='^bview.0.cursor.0.mark.line_index=1$'
expected[history_col ]='^bview.0.cursor.0.mark.col=0$'
source 'test.sh'