blob: 4f409764af62e3a6a5e6f590cbe8776c13510c11 (
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
|
// file : tests/erase/driver.cxx
// author : Boris Kolpackov <boris@codesynthesis.com>
// copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC
// license : MIT; see accompanying LICENSE file
// Test argument erasing.
//
#include <string>
#include <cassert>
#include "test.hxx"
using namespace std;
int
main (int argc, char* argv[])
{
options o (argc, argv, true,
cli::unknown_mode::skip,
cli::unknown_mode::skip);
assert (o.a ());
assert (o.b () == 123);
// We should have 'foo bar --arg -- -b 234'.
//
assert (argc == 7);
assert (argv[1] == string ("foo"));
assert (argv[2] == string ("bar"));
assert (argv[3] == string ("--arg"));
assert (argv[4] == string ("--"));
assert (argv[5] == string ("-b"));
assert (argv[6] == string ("234"));
}
|