diff options
author | Marius Kintel <marius@kintel.net> | 2013-04-19 19:57:11 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2013-04-19 19:57:11 (GMT) |
commit | eb60b5f9377b71115741d9632f9b62f77c441dbc (patch) | |
tree | 44c50b36478abf5e7973b241ed00d9f39f6eda98 | |
parent | 7342ff7cf93edfbe80c559a6128fbafaddbf93b5 (diff) |
Tag search failures as warnings
-rw-r--r-- | src/func.cc | 8 | ||||
-rw-r--r-- | tests/regression/echotest/search-tests-expected.txt | 12 |
2 files changed, 10 insertions, 10 deletions
diff --git a/src/func.cc b/src/func.cc index 791e957..26d7e69 100644 --- a/src/func.cc +++ b/src/func.cc @@ -449,7 +449,7 @@ Value builtin_search(const Context *, const std::vector<std::string>&, const std if (num_returns_per_match > 1 && matchCount >= num_returns_per_match) break; } } - if (matchCount == 0) PRINTB(" search term not found: \"%s\"", findThis.toString()[i]); + if (matchCount == 0) PRINTB(" WARNING: search term not found: \"%s\"", findThis.toString()[i]); if (num_returns_per_match == 0 || num_returns_per_match > 1) { returnvec.push_back(Value(resultvec)); } @@ -478,10 +478,10 @@ Value builtin_search(const Context *, const std::vector<std::string>&, const std } if (num_returns_per_match == 1 && matchCount == 0) { if (findThis.toVector()[i].type() == Value::NUMBER) { - PRINTB(" search term not found: %s",findThis.toVector()[i].toDouble()); + PRINTB(" WARNING: search term not found: %s",findThis.toVector()[i].toDouble()); } else if (findThis.toVector()[i].type() == Value::STRING) { - PRINTB(" search term not found: \"%s\"",findThis.toVector()[i].toString()); + PRINTB(" WARNING: search term not found: \"%s\"",findThis.toVector()[i].toString()); } returnvec.push_back(Value(resultvec)); } @@ -490,7 +490,7 @@ Value builtin_search(const Context *, const std::vector<std::string>&, const std } } } else { - PRINTB(" search: none performed on input %s", findThis); + PRINTB(" WARNING: search: none performed on input %s", findThis); return Value(); } return Value(returnvec); diff --git a/tests/regression/echotest/search-tests-expected.txt b/tests/regression/echotest/search-tests-expected.txt index 64df0b6..0269f43 100644 --- a/tests/regression/echotest/search-tests-expected.txt +++ b/tests/regression/echotest/search-tests-expected.txt @@ -1,9 +1,9 @@ - search term not found: "q" - search term not found: 1000 - search term not found: "zzz" - search term not found: "zzz" - search term not found: 500 - search term not found: "" + WARNING: search term not found: "q" + WARNING: search term not found: 1000 + WARNING: search term not found: "zzz" + WARNING: search term not found: "zzz" + WARNING: search term not found: 500 + WARNING: search term not found: "" ECHO: "Characters in string (\"a\"): [0]" ECHO: "Characters in string (\"adeq\"): [[0, 5], [3, 8], [4], []]" ECHO: "Default string search (\"abe\"): [0, 1, 8]" |