_M_update(size_t __new)
{
_M_printwidth += __new;
- if (_M_buffering())
- return true;
- return _M_force_update();
+ // Compute estimated width, to see if is not reduced.
+ if (_M_printwidth >= _M_padwidth || _M_printwidth >= _M_maxwidth)
+ return _M_force_update();
+ return true;
}
void
VERIFY( strip_prefix(resv, 48, '*') );
VERIFY( resv == inv );
+ resv = res = std::format("{:*>300.200s}", in);
+ VERIFY( strip_prefix(resv, 108, '*') );
+ VERIFY( resv == inv );
+
resv = res = std::format("{:*>240.200s}", in);
VERIFY( strip_prefix(resv, 48, '*') );
VERIFY( resv == inv );
VERIFY( strip_quotes(resv) );
VERIFY( resv == inv );
+ resv = res = std::format("{:*>300.200?}", in);
+ VERIFY( strip_prefix(resv, 106, '*') );
+ VERIFY( strip_quotes(resv) );
+ VERIFY( resv == inv );
+
resv = res = std::format("{:*>240.200?}", in);
VERIFY( strip_prefix(resv, 46, '*') );
VERIFY( strip_quotes(resv) );
resv = res = std::format("{:*>10n:}", vs);
VERIFY( check_elems(resv, false) );
+ resv = res = std::format("{:*>256}", vs);
+ VERIFY( strip_prefix(resv, 48, '*') );
+ VERIFY( strip_squares(resv) );
+ VERIFY( check_elems(resv, true) );
+
+ resv = res = std::format("{:*>256n}", vs);
+ VERIFY( strip_prefix(resv, 50, '*') );
+ VERIFY( check_elems(resv, true) );
+
resv = res = std::format("{:*>240}", vs);
VERIFY( strip_prefix(resv, 32, '*') );
VERIFY( strip_squares(resv) );