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

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

using namespace std;
using namespace hello;

int main ()
{
  // 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");
  }
}