X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fsupport%2Ftests%2Fcheck_trivstring.cpp;h=1b604657f4f8085a62ee2fe055ea9f5f53e39db8;hb=8d640dc77608bedddb5b00982c23665584f52d21;hp=f2c44e44ad38fd6fc66ad301d679a40dcf45a38f;hpb=83bee109db2f535b1a92b02eef811c1476d9f9cf;p=lyx.git diff --git a/src/support/tests/check_trivstring.cpp b/src/support/tests/check_trivstring.cpp index f2c44e44ad..1b604657f4 100644 --- a/src/support/tests/check_trivstring.cpp +++ b/src/support/tests/check_trivstring.cpp @@ -68,6 +68,13 @@ void test_trivstring() cout << (c == a) << ' ' << (a == c) << endl; // equal strings cout << (a == f) << ' ' << (f == a) << endl; // different strings, same length cout << (a == g) << ' ' << (g == a) << endl; // different strings, different length + // operator[] + cout << d[1] << d[0] << endl; + // substr() + cout << d.substr(1) << endl; // default argument + cout << d.substr(1, 1) << endl; // maximum length + cout << d.substr(1, 2) << endl; // length larger than max + cout << d.substr(2) << endl; // maximum pos } void test_trivdocstring() @@ -129,6 +136,13 @@ void test_trivdocstring() cout << (c == a) << ' ' << (a == c) << endl; // equal strings cout << (a == f) << ' ' << (f == a) << endl; // different strings, same length cout << (a == g) << ' ' << (g == a) << endl; // different strings, different length + // operator[] + cout << static_cast(d[1]) << static_cast(d[0]) << endl; + // substr() + cout << to_ascii(d.substr(1)) << endl; // default argument + cout << to_ascii(d.substr(1, 1)) << endl; // maximum length + cout << to_ascii(d.substr(1, 2)) << endl; // length larger than max + cout << to_ascii(d.substr(2)) << endl; // maximum pos } int main()