2547
This commit is contained in:
parent
7874586ebd
commit
e94453100d
|
@ -255,7 +255,7 @@ int trace_count(string label, string line) {
|
|||
long result = 0;
|
||||
for (vector<trace_line>::iterator p = Trace_stream->past_lines.begin(); p != Trace_stream->past_lines.end(); ++p) {
|
||||
if (label == p->label) {
|
||||
if (line == "" || line == trim(p->contents))
|
||||
if (line == "" || trim(line) == trim(p->contents))
|
||||
++result;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,6 +10,12 @@ void test_trace_check_ignores_other_layers() {
|
|||
CHECK_TRACE_DOESNT_CONTAIN("test layer 2: foo");
|
||||
}
|
||||
|
||||
void test_trace_check_ignores_leading_whitespace() {
|
||||
trace("test layer 1") << " foo" << end();
|
||||
CHECK(trace_count("test layer 1", /*too little whitespace*/"foo") == 1);
|
||||
CHECK(trace_count("test layer 1", /*too much whitespace*/" foo") == 1);
|
||||
}
|
||||
|
||||
void test_trace_check_ignores_other_lines() {
|
||||
trace("test layer 1") << "foo" << end();
|
||||
trace("test layer 1") << "bar" << end();
|
||||
|
|
Loading…
Reference in New Issue