~sircmpwn/scdoc

ref: 7f298175918c16b3bc467b47bde976def0650d68 scdoc/test/inline-formatting -rwxr-xr-x 702 bytes
7f298175Drew DeVault Use a more robust approach for in-word-underscores 2 years ago
                                                                                
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
#!/bin/sh
. test/lib.sh

begin "Disallows nested formatting"
scdoc <<EOF >/dev/null
test(8)

_hello *world*_
EOF
end 1

begin "Ignores underscores in words"
scdoc <<EOF | grep -v 'fR' >/dev/null
test(8)

hello_world
EOF
end 0

begin "Allows underscores in bolded words"
scdoc <<EOF | grep '^\\fBhello_world\\fR' >/dev/null
test(8)

*hello_world*
EOF
end 0

begin "Emits bold text"
scdoc <<EOF | grep '^hello \\fBworld\\fR' >/dev/null
test(8)

hello *world*
EOF
end 0

begin "Emits underlined text"
scdoc <<EOF | grep '^hello \\fIworld\\fR' >/dev/null
test(8)

hello _world_
EOF
end 0

begin "Handles escaped characters"
scdoc <<EOF | grep '^hello _world_' >/dev/null
test(8)

hello \_world\_
EOF
end 0