tools: simplify on/off attribute printing

refs #4004

Change-Id: Idb666ff4dbeddc37f1cb10710ba3d75f7fe8bdb5
diff --git a/tests/tools/nfdc/format-helpers.t.cpp b/tests/tools/nfdc/format-helpers.t.cpp
index a94d2ba..5de002b 100644
--- a/tests/tools/nfdc/format-helpers.t.cpp
+++ b/tests/tools/nfdc/format-helpers.t.cpp
@@ -118,6 +118,14 @@
   BOOST_CHECK(os.is_equal(" id=500\nuri=udp4://192.0.2.1:6363\n"));
 }
 
+BOOST_AUTO_TEST_CASE(OnOff)
+{
+  output_test_stream os;
+  os << 'A' << text::OnOff{true} << 'B' << text::OnOff{false} << 'C';
+
+  BOOST_CHECK(os.is_equal("AonBoffC"));
+}
+
 BOOST_AUTO_TEST_SUITE_END() // Text
 
 BOOST_AUTO_TEST_SUITE_END() // TestFormatHelpers