Files
cpp-course/modules/06_oop_basics/test/constructors_test.cpp
T

17 lines
421 B
C++
Raw Normal View History

2026-08-11 17:40:36 +03:00
#include "constructors.hpp"
#include <gtest/gtest.h>
TEST(Constructors, InitialAndAppend) {
oop::StringBuilder builder("Hi");
builder.append(" there");
EXPECT_EQ(builder.str(), "Hi there");
}
TEST(Constructors, CopySemantics) {
oop::StringBuilder original("C++");
oop::StringBuilder copy = original;
copy.append("11");
EXPECT_EQ(original.str(), "C++");
EXPECT_EQ(copy.str(), "C++11");
}