blob: f9b7b6078cef356f7a2ea8ea21d7db11647ff233 (
plain)
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
28
29
30
31
32
33
34
35
36
|
// file : tests/inheritance/driver.cxx
// author : Boris Kolpackov <boris@codesynthesis.com>
// copyright : Copyright (c) 2009-2018 Code Synthesis Tools CC
// license : MIT; see accompanying LICENSE file
// Test option class inheritance.
//
#include <string>
#include <cassert>
#include <iostream>
#include "test.hxx"
using namespace std;
int
main (int argc, char* argv[])
{
const cli::options& d (options::description ());
assert (d.size () == 4);
assert (d[0].name () == "--very-long-flag");
assert (d[1].name () == "-i");
assert (d[2].name () == "-s");
assert (d[3].name () == "--string");
options o (argc, argv);
assert (o.very_long_flag ());
assert (o.s () == "short");
assert (o.i () == 123);
assert (o.string () == "long");
options::print_usage (cout);
}
|