summaryrefslogtreecommitdiff
path: root/libhello/tests/basics/driver.cxx
blob: 295c8f649e0d53cc8d319795f9f164ec14b371ed (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
#include <sstream>

#include <libhello/version.hxx>
#include <libhello/hello.hxx>

#undef NDEBUG
#include <cassert>

int main ()
{
  using namespace std;
  using namespace hello;

  // Basics.
  //
  {
    ostringstream o;
    say_hello_formatted (o, "Hi, World!");
    assert (o.str () == "Hi, World!\n");
  }

  {
    ostringstream o;
    say_hello (o, "World");
    assert (o.str () == "Hello, World!\n");
  }

  // Volume.
  //
  {
    ostringstream o;
    say_hello (o, "World", format::volume::loud);
    assert (o.str () == "HELLO, World!\n");
  }
}