Debian Codegraph @

test/inline-formatting

raw symbols SCIP
1 #!/bin/sh
2 . test/lib.sh
3
4 begin "Disallows nested formatting"
5 scdoc <<EOF >/dev/null
6 test(8)
7
8 _hello *world*_
9 EOF
10 end 1
11
12 begin "Ignores underscores in words"
13 scdoc <<EOF | grep -v 'fR' >/dev/null
14 test(8)
15
16 hello_world
17 EOF
18 end 0
19
20 begin "Ignores underscores in underlined words"
21 scdoc <<EOF | grep '\\fIhello_world\\fR' >/dev/null
22 test(8)
23
24 _hello_world_
25 EOF
26 end 0
27
28 begin "Ignores underscores in bolded words"
29 scdoc <<EOF | grep '^\\fBhello_world\\fR' >/dev/null
30 test(8)
31
32 *hello_world*
33 EOF
34 end 0
35
36 begin "Emits bold text"
37 scdoc <<EOF | grep '^hello \\fBworld\\fR' >/dev/null
38 test(8)
39
40 hello *world*
41 EOF
42 end 0
43
44 begin "Emits underlined text"
45 scdoc <<EOF | grep '^hello \\fIworld\\fR' >/dev/null
46 test(8)
47
48 hello _world_
49 EOF
50 end 0
51
52 begin "Emits bold text followed by underlined text"
53 scdoc <<EOF | grep '^\\fBhello\\fR\\fIworld\\fR' >/dev/null
54 test(8)
55
56 *hello*_world_
57 EOF
58 end 0
59
60 begin "Emits underlined text followed by bold text"
61 scdoc <<EOF | grep '^\\fIhello\\fR\\fBworld\\fR' >/dev/null
62 test(8)
63
64 _hello_*world*
65 EOF
66 end 0
67
68 begin "Handles escaped characters"
69 scdoc <<EOF | grep '^hello _world_' >/dev/null
70 test(8)
71
72 hello \_world\_
73 EOF
74 end 0
75
76 begin "Escapes hyphens in body text"
77 scdoc <<EOF | grep '^Body: \\-\\-body \\-b \\-1 long\\-term' >/dev/null
78 test(8)
79
80 Body: --body -b -1 long-term
81 EOF
82 end 0