~sircmpwn/scdoc

scdoc/test/inline-formatting -rwxr-xr-x 837 bytes
7bdbb5ba — Sebastian Disallows differing row lengths in table 22 days 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
51
52
53
54
55
56
57
58
#!/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 "Ignores underscores in underlined words"
scdoc <<EOF | grep '\\fIhello_world\\fR' >/dev/null
test(8)

_hello_world_
EOF
end 0

begin "Ignores 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