@@ -37,7 +37,7 @@ void test() {
37
37
assert (!sp.empty ());
38
38
assert (sp.size () == 4 );
39
39
40
- // Mode: default (`in` | ` out`)
40
+ // Mode: default (`out`)
41
41
{
42
42
SpStream rhsSpSt{sp};
43
43
assert (rhsSpSt.span ().data () == arr);
@@ -54,23 +54,6 @@ void test() {
54
54
assert (rhsSpSt.span ().empty ());
55
55
assert (rhsSpSt.span ().size () == 0 );
56
56
}
57
- // Mode: `in`
58
- {
59
- SpStream rhsSpSt{sp, std::ios_base::in};
60
- assert (rhsSpSt.span ().data () == arr);
61
- assert (rhsSpSt.span ().empty ());
62
- assert (rhsSpSt.span ().size () == 0 );
63
-
64
- SpStream spSt{std::move (rhsSpSt)};
65
- assert (spSt.span ().data () == arr);
66
- assert (spSt.span ().empty ());
67
- assert (spSt.span ().size () == 0 );
68
-
69
- // Test after move
70
- assert (rhsSpSt.span ().data () == arr);
71
- assert (rhsSpSt.span ().empty ());
72
- assert (rhsSpSt.span ().size () == 0 );
73
- }
74
57
// Mode `out`
75
58
{
76
59
SpStream rhsSpSt{sp, std::ios_base::out};
@@ -88,26 +71,26 @@ void test() {
88
71
assert (rhsSpSt.span ().empty ());
89
72
assert (rhsSpSt.span ().size () == 0 );
90
73
}
91
- // Mode: multiple
74
+ // Mode `ate`
92
75
{
93
- SpStream rhsSpSt{sp, std::ios_base::in | std::ios_base:: out | std::ios_base::binary };
76
+ SpStream rhsSpSt{sp, std::ios_base::out | std::ios_base::ate };
94
77
assert (rhsSpSt.span ().data () == arr);
95
- assert (rhsSpSt.span ().empty ());
96
- assert (rhsSpSt.span ().size () == 0 );
78
+ assert (! rhsSpSt.span ().empty ());
79
+ assert (rhsSpSt.span ().size () == 4 );
97
80
98
81
SpStream spSt{std::move (rhsSpSt)};
99
82
assert (spSt.span ().data () == arr);
100
- assert (spSt.span ().empty ());
101
- assert (spSt.span ().size () == 0 );
83
+ assert (! spSt.span ().empty ());
84
+ assert (spSt.span ().size () == 4 );
102
85
103
86
// Test after move
104
87
assert (rhsSpSt.span ().data () == arr);
105
- assert (rhsSpSt.span ().empty ());
106
- assert (rhsSpSt.span ().size () == 0 );
88
+ assert (! rhsSpSt.span ().empty ());
89
+ assert (rhsSpSt.span ().size () == 4 );
107
90
}
108
- // Mode `ate`
91
+ // Mode: multiple
109
92
{
110
- SpStream rhsSpSt{sp, std::ios_base::out | std::ios_base::ate };
93
+ SpStream rhsSpSt{sp, std::ios_base::ate | std::ios_base::binary };
111
94
assert (rhsSpSt.span ().data () == arr);
112
95
assert (!rhsSpSt.span ().empty ());
113
96
assert (rhsSpSt.span ().size () == 4 );
@@ -128,12 +111,22 @@ int main(int, char**) {
128
111
#ifndef TEST_HAS_NO_NASTY_STRING
129
112
test<nasty_char, nasty_char_traits>();
130
113
#endif
114
+
131
115
test<char >();
132
116
test<char , constexpr_char_traits<char >>();
133
117
#ifndef TEST_HAS_NO_WIDE_CHARACTERS
134
118
test<wchar_t >();
135
119
test<wchar_t , constexpr_char_traits<wchar_t >>();
136
120
#endif
137
121
122
+ #ifndef TEST_HAS_NO_CHAR8_T
123
+ test<char8_t >();
124
+ test<char8_t , constexpr_char_traits<char8_t >>();
125
+ #endif
126
+ test<char16_t >();
127
+ test<char16_t , constexpr_char_traits<char16_t >>();
128
+ test<char32_t >();
129
+ test<char32_t , constexpr_char_traits<char32_t >>();
130
+
138
131
return 0 ;
139
132
}
0 commit comments