Fill in some disabled tests

This CL completes a few of the DISABLED tests.

Change-Id: I38806fb9381240d6e3da700f1fb2dac5f899ca6d
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/19000
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
This commit is contained in:
dan sinclair
2020-04-07 19:27:49 +00:00
parent 1c9b486d6e
commit 0e9d9ed60f
4 changed files with 28 additions and 11 deletions

View File

@@ -39,6 +39,9 @@ class Generator : public writer::Writer {
/// @returns the result data
std::string result() const { return impl_.result(); }
/// @returns the error
std::string error() const { return impl_.error(); }
private:
GeneratorImpl impl_;
};

View File

@@ -23,7 +23,17 @@ namespace {
using GeneratorImplTest = testing::Test;
TEST_F(GeneratorImplTest, DISABLED_Generate) {}
TEST_F(GeneratorImplTest, Generate) {
ast::Module m;
m.AddImport(std::make_unique<ast::Import>("GLSL.std.430", "a"));
GeneratorImpl g;
ASSERT_TRUE(g.Generate(m)) << g.error();
EXPECT_EQ(g.result(), R"(import "GLSL.std.430" as a;
)");
}
} // namespace
} // namespace wgsl