Enhancement - Record::has

- Implemented Record::has which guarantees no autovivification of
  attributes.
This commit is contained in:
Paul Beckingham
2009-06-11 20:29:53 -04:00
parent 1ff3e73ebc
commit 754b79afb2
3 changed files with 16 additions and 1 deletions

View File

@@ -35,7 +35,7 @@ Context context;
////////////////////////////////////////////////////////////////////////////////
int main (int argc, char** argv)
{
UnitTest t (17);
UnitTest t (19);
// (blank)
bool good = true;
@@ -85,6 +85,10 @@ int main (int argc, char** argv)
record.set ("name", "value");
t.is (record.composeF4 (), "[name:\"value\"]\n", "Record::set");
// Record::has
t.ok (record.has ("name"), "Record::has");
t.notok (record.has ("woof"), "Record::has not");
// Record::get_int
record.set ("one", 1);
t.is (record.composeF4 (), "[name:\"value\" one:\"1\"]\n", "Record::set");