diff options
author | Neil MacIntosh <neilmac@microsoft.com> | 2015-11-05 20:29:30 +0300 |
---|---|---|
committer | Neil MacIntosh <neilmac@microsoft.com> | 2015-11-05 20:29:30 +0300 |
commit | 4e4882bda8dee92d05c11708a016f3409abed963 (patch) | |
tree | 609604d9beb69bebd727b710c41ac945b8f8dc0d /tests/string_span_tests.cpp | |
parent | caabb40440f44b24b573a0822433ea758b469b96 (diff) |
Added workaround for MSVC 2013 compiler bug.
Diffstat (limited to 'tests/string_span_tests.cpp')
-rw-r--r-- | tests/string_span_tests.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/string_span_tests.cpp b/tests/string_span_tests.cpp index dc3ccf5..ab48fcb 100644 --- a/tests/string_span_tests.cpp +++ b/tests/string_span_tests.cpp @@ -22,6 +22,7 @@ using namespace std; using namespace gsl; + SUITE(string_span_tests) { @@ -104,6 +105,18 @@ SUITE(string_span_tests) string_span<> v3 = "Hello"; #endif } + + TEST(TestToString) + { + auto s = gsl::to_string(cstring_span<>{}); + CHECK(s.length() == 0); + + char stack_string[] = "Hello"; + cstring_span<> v = ensure_z(stack_string); + auto s2 = gsl::to_string(v); + CHECK(s2.length() == v.length()); + CHECK(s2.length() == 5); + } } int main(int, const char *[]) |