4 #include <UnitTest++.h>
9 TEST(TestLgIsCommentSeq)
48 TEST(TestLgInputComment)
69 TEST(TestStripComment)
71 string line =
"command # comment\n";
73 CHECK( line ==
"command # comment" );
75 line =
"command ## comment\n";
77 CHECK( line ==
"command " );
79 line =
"command // comment\n";
81 CHECK( line ==
"command " );
83 line =
"command % comment\n";
85 CHECK( line ==
"command " );
87 line =
"command * comment\n";
89 CHECK( line ==
"command * comment" );
91 line =
"command ; comment\n";
93 CHECK( line ==
"command " );
95 line =
"command c comment\n";
97 CHECK( line ==
"command c comment" );
99 line =
"command # comment\n";
101 CHECK( line ==
"command " );
103 line =
"command ## comment\n";
105 CHECK( line ==
"command " );
107 line =
"command // comment\n";
109 CHECK( line ==
"command " );
111 line =
"command % comment\n";
113 CHECK( line ==
"command " );
115 line =
"command * comment\n";
117 CHECK( line ==
"command * comment" );
119 line =
"command ; comment\n";
121 CHECK( line ==
"command " );
123 line =
"command c comment\n";
125 CHECK( line ==
"command c comment" );
127 line =
"command \"# ## // % * ; c text\"\n";
129 CHECK( line ==
"command \"# ## // % * ; c text\"" );
131 line =
"command #\"# ## // % * ; c text\"\n";
133 CHECK( line ==
"command " );
135 line =
"command \"# ## // % * ; c text\n";
137 CHECK( line ==
"command \"# ## // % * ; c text" );
139 line =
"command # \"# ## // % * ; c text\n";
141 CHECK( line ==
"command " );
143 line =
"command # \"# ## // % * ; c text\n";
145 CHECK( line ==
"command # \"# ## // % * ; c text" );
150 line =
"command \"file_name[]\" _on_ # comment _ [ ]\n";
152 CHECK( line ==
"command \"file_name[]\" on # comment _ [ ]" );
155 line =
"command param\r";
157 CHECK( line ==
"command param" );
159 line =
"# comment ## another comment\r";
161 CHECK( line ==
"# comment ## another comment" );
163 line =
"command # comment ## another comment\n";
165 CHECK( line ==
"command # comment ## another comment" );
170 string line =
"\"label \\ # ## // % * ; c text_23[]\"";
173 CHECK( label ==
"label \\ # ## // % * ; c text_23[]" );
174 CHECK( p == line.length() );
178 CHECK( label ==
"" );
179 CHECK( p == string::npos );