Add some tests.
[command.git] / tests / parameter / is_descriptive.cpp
1 #include <cstring>
2 #include <iostream>
3
4 #include "parameter.h"
5
6 using namespace std;
7 using namespace command;
8
9 #define STRING "1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
10
11 class TestParameter : public Parameter {
12 public:
13     TestParameter(std::string description) : Parameter(description) { }
14
15     virtual void handle() { }
16     virtual bool understand(std::string argVal) { }
17 };
18
19 int main() {
20     TestParameter parameter(STRING);
21
22     int cmp = strcmp(parameter.describe().c_str(), STRING);
23
24     if (cmp == 0) {
25         cout << "Parameter class is descriptive\n";
26         return 0;
27     }
28
29     cout << "Parameter class changes provided description so is not descriptive\n";
30
31     return 1;
32 }
33