From baca71db9a972a7d17eac0501da9c6610a5b3b7e Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Mon, 16 Mar 2020 13:47:24 +0000 Subject: [PATCH] Add LocationDecoration ToStr test. Bug: tint:11 Change-Id: I8327d2f3961e4d8d74c6339b66ba36218126e63e Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/16562 Reviewed-by: Sarah Mashayekhi --- src/ast/kill_statement_test.cc | 1 - src/ast/location_decoration_test.cc | 10 ++++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/ast/kill_statement_test.cc b/src/ast/kill_statement_test.cc index 35e1b378f8..63115c7857 100644 --- a/src/ast/kill_statement_test.cc +++ b/src/ast/kill_statement_test.cc @@ -55,4 +55,3 @@ TEST_F(KillStatementTest, ToStr) { } // namespace ast } // namespace tint - diff --git a/src/ast/location_decoration_test.cc b/src/ast/location_decoration_test.cc index 78581939d3..c68253ad0e 100644 --- a/src/ast/location_decoration_test.cc +++ b/src/ast/location_decoration_test.cc @@ -14,6 +14,8 @@ #include "src/ast/location_decoration.h" +#include + #include "gtest/gtest.h" namespace tint { @@ -34,5 +36,13 @@ TEST_F(LocationDecorationTest, Is) { EXPECT_FALSE(d.IsSet()); } +TEST_F(LocationDecorationTest, ToStr) { + LocationDecoration d{2}; + std::ostringstream out; + d.to_str(out); + EXPECT_EQ(out.str(), R"(LocationDecoration{2} +)"); +} + } // namespace ast } // namespace tint