diff options
Diffstat (limited to 'libcxx/test/std/re/re.results/re.results.acc/suffix.pass.cpp')
-rw-r--r-- | libcxx/test/std/re/re.results/re.results.acc/suffix.pass.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/libcxx/test/std/re/re.results/re.results.acc/suffix.pass.cpp b/libcxx/test/std/re/re.results/re.results.acc/suffix.pass.cpp new file mode 100644 index 00000000000..b842ea861e4 --- /dev/null +++ b/libcxx/test/std/re/re.results/re.results.acc/suffix.pass.cpp @@ -0,0 +1,34 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <regex> + +// class match_results<BidirectionalIterator, Allocator> + +// const_reference suffix() const; + +#include <regex> +#include <cassert> + +void +test() +{ + std::match_results<const char*> m; + const char s[] = "abcdefghijk"; + assert(std::regex_search(s, m, std::regex("cd((e)fg)hi"))); + + assert(m.suffix().first == s+9); + assert(m.suffix().second == s+11); + assert(m.suffix().matched == true); +} + +int main() +{ + test(); +} |