From 1853e964e96c41e762ca0ab97259ee4e79d86ec7 Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Mon, 3 Nov 2014 13:35:54 -0800 Subject: Use the new ASTs --- src/ast/item_test.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/ast/item_test.cpp') diff --git a/src/ast/item_test.cpp b/src/ast/item_test.cpp index 3b5fd07..a77662e 100644 --- a/src/ast/item_test.cpp +++ b/src/ast/item_test.cpp @@ -24,7 +24,7 @@ #include "../tests/fdhack.hpp" -//#include "../poison.hpp" +#include "../poison.hpp" namespace tmwa @@ -54,7 +54,7 @@ namespace item { io::LineCharReader lr(io::from_string, ""_s, input); auto res = parse_item(lr); - EXPECT_EQ(res.get_success(), Some(std::unique_ptr(nullptr))); + EXPECT_TRUE(res.is_none()); } } TEST(itemast, comment) @@ -70,11 +70,11 @@ namespace item for (auto input : inputs) { io::LineCharReader lr(io::from_string, ""_s, input); - auto res = parse_item(lr); + auto res = TRY_UNWRAP(parse_item(lr), FAIL()); EXPECT_TRUE(res.get_success().is_some()); auto top = TRY_UNWRAP(std::move(res.get_success()), FAIL()); - EXPECT_SPAN(top->span, 1,1, 1,8); - auto p = dynamic_cast(top.get()); + EXPECT_SPAN(top.span, 1,1, 1,8); + auto p = top.get_if(); EXPECT_TRUE(p); if (p) { @@ -96,11 +96,11 @@ namespace item for (auto input : inputs) { io::LineCharReader lr(io::from_string, ""_s, input); - auto res = parse_item(lr); + auto res = TRY_UNWRAP(parse_item(lr), FAIL()); EXPECT_TRUE(res.get_success().is_some()); auto top = TRY_UNWRAP(std::move(res.get_success()), FAIL()); - EXPECT_SPAN(top->span, 1,1, 1,58); - auto p = dynamic_cast(top.get()); + EXPECT_SPAN(top.span, 1,1, 1,58); + auto p = top.get_if(); EXPECT_TRUE(p); if (p) { -- cgit v1.2.3-70-g09d2