Test for PIString 11-20

This commit is contained in:
2021-01-22 10:46:36 +03:00
parent 91cfea7450
commit d9bba66cc7

View File

@@ -79,3 +79,71 @@ TEST(PIString_Tests, operator_concatenation_pistring_zero2){
str1 += str2; str1 += str2;
ASSERT_EQ(str1, "AB C"); ASSERT_EQ(str1, "AB C");
} }
TEST(PIString_Tests, operator_concatenation_pistring_zero_zero){
PIString str1;
PIString str2;
str1 += str2;
ASSERT_EQ(str1, "");
}
TEST(PIString_Tests, operator_concatenation_piByteArray){
PIString str1 = "AB C";
PIByteArray str2;
str2.append('g');
str1 += str2;
ASSERT_EQ(str1, "AB Cg");
}
TEST(PIString_Tests, operator_concatenation_piByteArray_zero1){
PIString str1 = "";
PIByteArray str2;
str2.append('0');
str1 += str2;
ASSERT_EQ(str1, "0");
}
TEST(PIString_Tests, operator_concatenation_piByteArray_zero2){
PIString str1 = "AB C";
PIByteArray str2;
str1 += str2;
ASSERT_EQ(str1, "AB C");
}
TEST(PIString_Tests, operator_concatenation_piByteArray_zero_zero){
PIString str1;
PIByteArray str2;
str1 += str2;
ASSERT_EQ(str1, "");
}
TEST(PIString_Tests, construct_pistring){
PIString str1 = "New";
PIString str(str1);
ASSERT_EQ(str1, str);
}
TEST(PIString_Tests, construct_pistring_move){
PIString str1 = "New";
PIString res = str1;
PIString str(move(str1));
ASSERT_EQ(res, str);
}
TEST(PIString_Tests, construct_pichar){
PIChar str1 = 'n';
PIString res = "n";
ASSERT_EQ(res, PIString(str1));
}
TEST(PIString_Tests, construct_char){
char str1 = 'n';
PIString res = "n";
ASSERT_EQ(res, PIString(str1));
}
TEST(PIString_Tests, construct_chars){
char str1[] = "mew";
PIString res = "mew";
ASSERT_EQ(res, PIString(str1));
}