diff options
author | Daniel Burrows <dburrows@debian.org> | 2011-04-05 20:44:00 -0700 |
---|---|---|
committer | Daniel Burrows <dburrows@debian.org> | 2011-04-05 20:44:00 -0700 |
commit | d16e02278ebff51570193cee9e69d62f49a05d0f (patch) | |
tree | 431768ae9834f960a7eecb9d190553f4a25e63b8 /tests | |
parent | a8d94be135abbf014545bf50e9f02cd105c61cc5 (diff) | |
download | aptitude-d16e02278ebff51570193cee9e69d62f49a05d0f.tar.gz |
Tighten pattern parsing tests.
* Verify that ~ parses as a name matcher, not a term matcher.
* Verify that a top-level bare string that's not ~ parses as a name matcher.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_matching.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/test_matching.cc b/tests/test_matching.cc index 768eb55f..7692c05a 100644 --- a/tests/test_matching.cc +++ b/tests/test_matching.cc @@ -1,6 +1,6 @@ // test_matching.cc // -// Copyright (C) 2008-2009 Daniel Burrows +// Copyright (C) 2008-2009, 2011 Daniel Burrows // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License as @@ -797,6 +797,12 @@ namespace { "?widen(?false)", "?widen(?false)", pattern::make_widen(pattern::make_false()) }, + + { "~", "?name(\"~\")", + pattern::make_name("~") }, + + { "abc", "?name(\"abc\")", + pattern::make_name("abc") }, }; const int num_test_patterns = sizeof(test_patterns) / sizeof(test_patterns[0]); |