From 6473dc0c72f759aa6c7dacb9609c0b284a405709 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Tue, 11 Apr 2017 15:52:10 -0600 Subject: [PATCH] Add test. --- tests/base/table_handler_15.cc | 48 ++++++++++++++++++++++++++++++ tests/base/table_handler_15.output | 3 ++ 2 files changed, 51 insertions(+) create mode 100644 tests/base/table_handler_15.cc create mode 100644 tests/base/table_handler_15.output diff --git a/tests/base/table_handler_15.cc b/tests/base/table_handler_15.cc new file mode 100644 index 0000000000..c6ffaeb972 --- /dev/null +++ b/tests/base/table_handler_15.cc @@ -0,0 +1,48 @@ +// --------------------------------------------------------------------- +// +// Copyright (C) 2017 by the deal.II authors +// +// This file is part of the deal.II library. +// +// The deal.II library is free software; you can use it, redistribute +// it, and/or modify it under the terms of the GNU Lesser General +// Public License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// The full text of the license can be found in the file LICENSE at +// the top level of the deal.II distribution. +// +// --------------------------------------------------------------------- + + +// test TableHandler::declare_column() + + +#include "../tests.h" +#include +#include +#include + +#include +#include +#include +#include + + +int main () +{ + initlog (); + + TableHandler table; + + // declare columns either directly, or by adding a value + table.declare_column ("key1"); + table.add_value("key2", 0); + table.declare_column ("key3"); + + // finish that row (even though there is something only in column 2) + // and output the whole shebang + table.start_new_row (); + + table.write_text(deallog.get_file_stream(), + TableHandler::org_mode_table); +} diff --git a/tests/base/table_handler_15.output b/tests/base/table_handler_15.output new file mode 100644 index 0000000000..746ed264d0 --- /dev/null +++ b/tests/base/table_handler_15.output @@ -0,0 +1,3 @@ + +| key1 | key2 | key3 | +| "" | 0 | "" | -- 2.39.5