File: test_mars_language_strict.cc

package info (click to toggle)
metkit 1.16.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,280 kB
  • sloc: cpp: 16,169; sh: 2,532; python: 790; ansic: 71; makefile: 19
file content (27 lines) | stat: -rw-r--r-- 785 bytes parent folder | download
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
#include <assert.h>
#include "eckit/testing/Test.h"
#include "metkit/mars/MarsLanguage.h"


namespace metkit::mars::test {

CASE("retrieve_best_match_param_not_matching") {
    const auto language = MarsLanguage("retrieve");

    // Strict is defaulted to true and this is not matching
    EXPECT_THROWS(language.bestMatch("param", {"parameter"}, false, false, true, {}));
};

CASE("retrieve_best_match_param_matching") {
    const auto language = MarsLanguage("retrieve");

    // Strict is defaulted to true and this is not matching
    auto match = language.bestMatch("param", {"parameter", "param"}, false, false, true, {});

    EXPECT(match == "param");
};

}  // namespace metkit::mars::test
int main(int argc, char** argv) {
    return eckit::testing::run_tests(argc, argv);
}