summaryrefslogtreecommitdiffstats
path: root/test/test_text_file.sh
blob: 57ac32ea17abbdd98a91c584b1764f5d0c77278d (plain)
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#! /bin/bash

export TZ=UTC
export YES_COLOR=1
unset XDG_CONFIG_HOME

run_cap_test ${lnav_test} -n \
    -c ':goto 5' \
    -c ':filter-out Lorem|sed' \
    ${test_dir}/textfile_plain.0

run_cap_test ${lnav_test} -n \
    ${top_srcdir}/README.md

run_cap_test ${lnav_test} -n -c ':goto #screenshot' \
    ${top_srcdir}/README.md

run_cap_test ${lnav_test} -n ${top_srcdir}/README.md#screenshot

# run_cap_test ${lnav_test} -n ${test_dir}/non-existent:4

run_cap_test ${lnav_test} -n ${top_srcdir}/README.md:-4

run_cap_test ${lnav_test} -n \
    -c ':goto 115' \
    -c ";SELECT top_meta FROM lnav_views WHERE name = 'text'" \
    -c ':write-json-to -' \
    ${top_srcdir}/README.md

run_cap_test ${lnav_test} -n \
    ${top_srcdir}/src/log_level.cc

cp ${test_dir}/UTF-8-test.txt UTF-8-test.md
run_cap_test ${lnav_test} -n \
    UTF-8-test.md

run_cap_test ${lnav_test} -n \
    -c ';SELECT * FROM lnav_file_metadata' \
    ${test_dir}/textfile_0.md

run_cap_test ${lnav_test} -n \
    ${test_dir}/textfile_ansi_expanding.0

run_cap_test ${lnav_test} -n \
    ${test_dir}/textfile_0.md

run_cap_test ${lnav_test} -n \
    ${test_dir}/pyfile_0.py

run_cap_test ${lnav_test} -n \
    ${test_dir}/man_echo.txt

run_cap_test ${lnav_test} -n \
    -c ";SELECT top_meta FROM lnav_views WHERE name = 'text'" \
    -c ':write-json-to -' \
    ${test_dir}/man_echo.txt

run_cap_test ${lnav_test} -n \
    -c ':goto 8' \
    -c ";SELECT top_meta FROM lnav_views WHERE name = 'text'" \
    -c ':write-json-to -' \
    < ${test_dir}/man_echo.txt

run_cap_test ${lnav_test} -n \
    -c ':goto 6' \
    -c ";SELECT top_meta FROM lnav_views WHERE name = 'text'" \
    -c ':write-json-to -' \
    < ${test_dir}/example.toml

run_cap_test ${lnav_test} -n \
    -c ':goto 9' \
    -c ";SELECT top_meta FROM lnav_views WHERE name = 'text'" \
    -c ':write-json-to -' \
    < ${test_dir}/example.patch

run_cap_test ${lnav_test} -n \
    < ${top_srcdir}/autogen.sh

run_cap_test ${lnav_test} -n \
    -c ';SELECT content FROM lnav_file' \
    ${test_dir}/textfile_nonl.txt

run_cap_test ${lnav_test} -n \
    -c ':goto 23' \
    -c ';SELECT top_meta FROM lnav_top_view' \
    -c ':write-json-to -' \
    ${test_dir}/formats/jsontest/format.json

run_cap_test ${lnav_test} -n \
    -c ':goto 3' \
    -c ':next-section' \
    ${test_dir}/books.json

run_cap_test ${lnav_test} -n \
    -c ':goto 3' \
    -c ':next-section' \
    < ${test_dir}/books.json

run_cap_test ${lnav_test} -n \
    -c ':goto #/catalog/1/title' \
    ${test_dir}/books.json

run_cap_test ${lnav_test} -n \
    -c ':goto #/catalog/1/title' \
    < ${test_dir}/books.json

echo "Hello, World!" | run_cap_test env TEST_COMMENT="piper crumbs" ${lnav_test} -n \
    -c ';SELECT top_meta FROM lnav_top_view' \
    -c ':write-json-to -'

echo "Hello, World!" | run_cap_test \
    env TEST_COMMENT="piper crumbs" TZ=America/Los_Angeles \
    ${lnav_test} -n \
    -c ';SELECT top_meta FROM lnav_top_view' \
    -c ':write-json-to -'

echo "Hello, World!" | run_cap_test \
    env TEST_COMMENT="piper crumbs" TZ=America/Los_Angeles \
    ${lnav_test} -nt

${test_dir}/naughty_files.py
run_cap_test ${lnav_test} -n naughty/file-with-hidden-text.txt

run_cap_test ${lnav_test} -n naughty/file-with-terminal-controls.txt