2 # nagios-mode test suite.
4 # Copyright Michael Orlitzky
6 # http://michael.orlitzky.com/
8 # This program is free software: you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation, either version 3 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # http://www.fsf.org/licensing/licenses/gpl.html
21 Test 1: Comments should be colored correctly.
23 ; Second comment form.
24 ; A comment not starting at the beginning of a line.
25 # And the second form of the above.
26 How about # a comment that starts after some non-comment text?
29 Test 2: Directives, specials, macros, definitions, and strings
30 within comments should appear as part of the comment.
31 # contacts is a directive.
32 # use, name, and register are specials.
33 # $USER1$ is an example of a macro.
34 # and define host is one of the possible definitions.
35 # Heck, let's try "strings" while we're at it.
38 Test 3: The standard "define host" below should be function-name-faced.
43 Test 4: The "define host" should be colored, but the braces *should not* be.
48 Test 5: Multiple spaces before the brace.
53 Test 6: Closing brace on the same line.
57 Test 7: Directive coloring should work at the beginning of a line.
61 Test 8: Directive coloring should work after any number of spaces.
65 Test 9: Directive coloring should work after a tab.
69 Test 10: Directives should not be colored in the middle of sentences.
70 Such as contacts in the middle of a sentence.
73 Test 11: Directives should not be colored at the end of a line.
77 Test 12: Directives should only be colored when they are stand-alone
78 words. Therefore, the following should *not* be colored.
87 Test 13: Definitions must be stand-alone as well. The following
88 should *not* be colored.
97 Test 14: Text inside of a open/close brace pair should be indented
100 This should be indented.
108 Test 15: Braces within comments should appear as part of the comment.
113 Test 16: Comments (and closing braces) that come after an curly
114 brace should all be comment-colored.
115 define host { # Everything hereafter is a { comment }.
116 } ; As well as here {}.
119 Test 17: Macros should be constant-faced under normal circumstances.
122 $ADMINEMAIL$ $ADMINPAGER$
125 Test 18: Macros should appear constant-faced even when they don't
126 occur along a word boundary.
128 $ADMINPAGER$="string"
132 Test 19: Macros within strings appear as part of the string
133 "I'm unsure if string $USER1$ interpolation is possible."
136 Test 20: Macros can occur within a directive/special value.
139 contacts $ADMINPAGER$
140 friday I'm $USER1$ love.
144 Test 21: Directives that occur as a special value should
145 be neither special- nor directive-faced.
152 Test 22: Directives that occur as directive values should
153 not be directive-faced.
155 monday tuesday wednesday thursday friday
159 Test 23: Specials that occur as special values should
160 not be special-faced.
166 Test 24: Specials that occur as a directive value should
167 be neither special- nor directive-faced.
174 Test 25: Definitions should work when not at the beginning
179 Test 26: Definitions that,
181 a) End with a curly brace followed by a newline
182 b) Have a special as the first entry
184 should be colored properly.
191 Test 27: Comment characters within strings should be ignored,
192 that is, treated like strings.
193 "Here comes a #comment"
194 "And the ;second form"
197 Test 28: Strings within comments should be ignored as well.
198 # The "string" should be comment-faced.
201 Test 29: Text between two strings should not be string-faced.
202 "String1" between "String2"
204 Test 30: The ARG0 and USER0 macros don't exist.
208 Test 31: Commented opening braces should not cause indentation.
210 This line should not be indented.
212 Neither should this line.
214 Test 32: Commented closing braces should not close a block.
217 # This is just a comment }
218 So this should be indented too.
222 Test 33: Double opening/closing braces shouldn't cause things
225 #{}}}}}{}{{}}}{{;{}{}{}
226 Still normal indentation.
227 }#{}}}}}}}{{{{{{{{{{{{{{{