~sircmpwn/scdoc

scdoc/test/indent -rwxr-xr-x 1.0 KiB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/bin/sh
. test/lib.sh

begin "Indents indented text"
scdoc <<EOF | grep ".RS 4" >/dev/null
test(8)

Not indented
	Indented one level
EOF
end 0

begin "Deindents following indented text"
scdoc <<EOF | grep ".RE" >/dev/null
test(8)

Not indented
	Indented one level
Not indented
EOF
end 0

begin "Disallows multi-step indents"
scdoc <<EOF >/dev/null
test(8)

Not indented
	Indented one level
			Indented three levels
Not indented
EOF
end 1

begin "Allows indentation changes > 1 in literal blocks"
scdoc <<EOF >/dev/null
test(8)

This is some code:

\`\`\`
foobar:
                # asdf
\`\`\`
EOF
end 0

begin "Allows multi-step dedents"
scdoc <<EOF >/dev/null
test(8)

Not indented
	Indented one level
		Indented two levels
Not indented
EOF
end 0

begin "Allows indented literal blocks"
scdoc <<EOF >/dev/null
test(8)

	\`\`\`
	This block is indented.
	\`\`\`
EOF
end 0

begin "Disallows dedenting in literal blocks"
scdoc <<EOF >/dev/null
test(8)

		\`\`\`
		This block is indented.
	This line is dedented past the start of the block.
		\`\`\`
EOF
end 1