|
ModErn Text Analysis
META Enumerates Textual Applications
|
#include <cmath>#include <iomanip>#include <string>#include <functional>#include <iostream>#include "util/printing.h"Go to the source code of this file.
Classes | |
| class | meta::testing::unit_test_exception |
| Exception class used to report errors in the unit test. More... | |
Namespaces | |
| meta | |
| The ModErn Text Analysis toolkit is a suite of natural language processing, classification, information retreival, data mining, and other applications of text processing. | |
| meta::testing | |
| Contains unit testing functions for the META toolkit. | |
Macros | |
| #define | ASSERT(expr) |
| Fail if expr is false; otherwise continue. More... | |
| #define | ASSERT_EQUAL(exp1, exp2) |
| Fail if exp1 != exp2; otherwise continue. More... | |
| #define | ASSERT_APPROX_EQUAL(exp1, exp2) |
| Fail if !(|exp1 - exp2| < epsilon); otherwise continue. More... | |
| #define | ASSERT_BINOP(exp1, exp2, binop) |
| Fail if !binop(exp1, exp2). More... | |
| #define | FAIL(why) |
| Fail this test case with an explanation. More... | |
| #define | ASSERT_LESS(exp1, exp2) |
| Fail if !(exp1 < exp2) More... | |
| #define | ASSERT_GREATER(exp1, exp2) |
| Fail if !(exp1 > exp2) More... | |
Functions | |
| std::string | meta::testing::filename (const std::string &path) |
| template<class T , class K , class BinOp > | |
| std::string | meta::testing::assert_equal (const T &expected, const K &actual, const char *expstr, const char *actstr, BinOp &&binop) |
| Allows the user to see what the evaluated statements are. More... | |
| template<class T , class K > | |
| std::string | meta::testing::assert_equal (const T &expected, const K &actual, const char *expstr, const char *actstr) |
| template<class T , class K > | |
| std::string | meta::testing::assert_approx_equal (const T &expected, const K &actual, const char *expstr, const char *actstr) |
| template<class T , class K > | |
| std::string | meta::testing::assert_less (const T &expected, const K &actual, const char *expstr, const char *actstr) |
| template<class T , class K > | |
| std::string | meta::testing::assert_greater (const T &expected, const K &actual, const char *expstr, const char *actstr) |
| template<class Func > | |
| int | meta::testing::run_test (const std::string &test_name, Func &&func) |
| Runs a unit test in a semi-controlled environment. More... | |
All files in META are dual-licensed under the MIT and NCSA licenses. For more details, consult the file LICENSE.mit and LICENSE.ncsa in the root of the project.
| #define ASSERT | ( | expr | ) |
| #define ASSERT_EQUAL | ( | exp1, | |
| exp2 | |||
| ) |
Fail if exp1 != exp2; otherwise continue.
| #define ASSERT_APPROX_EQUAL | ( | exp1, | |
| exp2 | |||
| ) |
Fail if !(|exp1 - exp2| < epsilon); otherwise continue.
| #define ASSERT_BINOP | ( | exp1, | |
| exp2, | |||
| binop | |||
| ) |
| #define FAIL | ( | why | ) |
Fail this test case with an explanation.
Give line number and file where the test case failed.
| #define ASSERT_LESS | ( | exp1, | |
| exp2 | |||
| ) |
Fail if !(exp1 < exp2)
| #define ASSERT_GREATER | ( | exp1, | |
| exp2 | |||
| ) |
Fail if !(exp1 > exp2)
1.8.9.1