From 2293a04b4936a11fc3e09f3df8a8ab591e034f29 Mon Sep 17 00:00:00 2001 From: Murarth Date: Mon, 17 Nov 2014 14:37:59 -0700 Subject: libsyntax: Add tests for `parse_view_item` --- src/libsyntax/util/parser_testing.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/libsyntax/util/parser_testing.rs') diff --git a/src/libsyntax/util/parser_testing.rs b/src/libsyntax/util/parser_testing.rs index d0faa3c6820..c1ea8f60b82 100644 --- a/src/libsyntax/util/parser_testing.rs +++ b/src/libsyntax/util/parser_testing.rs @@ -67,6 +67,13 @@ pub fn string_to_stmt(source_str : String) -> P { }) } +/// Parse a string, return a view item +pub fn string_to_view_item (source_str : String) -> ast::ViewItem { + with_error_checking_parse(source_str, |p| { + p.parse_view_item(Vec::new()) + }) +} + /// Parse a string, return a pat. Uses "irrefutable"... which doesn't /// (currently) affect parsing. pub fn string_to_pat(source_str: String) -> P { -- cgit 1.4.1-3-g733a5