mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 22:02:23 +01:00
Accessor renames on diagnostics+source buffer (#1133)
This commit is contained in:
@@ -16,16 +16,16 @@ namespace {
|
||||
|
||||
TEST(SourceBufferTest, StringRep) {
|
||||
auto buffer = SourceBuffer::CreateFromText(llvm::Twine("Hello") + " World");
|
||||
EXPECT_EQ("/text", buffer->Filename());
|
||||
EXPECT_EQ("Hello World", buffer->Text());
|
||||
EXPECT_EQ("/text", buffer->filename());
|
||||
EXPECT_EQ("Hello World", buffer->text());
|
||||
}
|
||||
|
||||
TEST(SourceBufferText, StringRepWithFilename) {
|
||||
// Give a custom filename.
|
||||
auto buffer =
|
||||
SourceBuffer::CreateFromText("Hello World Again!", "/custom/text");
|
||||
EXPECT_EQ("/custom/text", buffer->Filename());
|
||||
EXPECT_EQ("Hello World Again!", buffer->Text());
|
||||
EXPECT_EQ("/custom/text", buffer->filename());
|
||||
EXPECT_EQ("Hello World Again!", buffer->text());
|
||||
}
|
||||
|
||||
auto CreateTestFile(llvm::StringRef text) -> std::string {
|
||||
@@ -54,8 +54,8 @@ TEST(SourceBufferTest, FileRep) {
|
||||
|
||||
SourceBuffer& buffer = *expected_buffer;
|
||||
|
||||
EXPECT_EQ(test_file_path, buffer.Filename());
|
||||
EXPECT_EQ("Hello World", buffer.Text());
|
||||
EXPECT_EQ(test_file_path, buffer.filename());
|
||||
EXPECT_EQ("Hello World", buffer.text());
|
||||
}
|
||||
|
||||
TEST(SourceBufferTest, FileRepEmpty) {
|
||||
@@ -67,8 +67,8 @@ TEST(SourceBufferTest, FileRepEmpty) {
|
||||
|
||||
SourceBuffer& buffer = *expected_buffer;
|
||||
|
||||
EXPECT_EQ(test_file_path, buffer.Filename());
|
||||
EXPECT_EQ("", buffer.Text());
|
||||
EXPECT_EQ(test_file_path, buffer.filename());
|
||||
EXPECT_EQ("", buffer.text());
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
Reference in New Issue
Block a user