Permalink
Browse files

Adapted protobuffs_tests: Replaced duplicate code with use of exporte…

…d function.
  • Loading branch information...
1 parent 3a85c65 commit 9a35195cf052ce078bb6995f81f6e127671d3d91 @eriksoe eriksoe committed Jun 30, 2011
Showing with 1 addition and 15 deletions.
  1. +1 −15 test/protobuffs_tests.erl
View
16 test/protobuffs_tests.erl
@@ -252,19 +252,5 @@ parse_extend_in_reserved_range_test_() ->
%% Help functions
%%--------------------------------------------------------------------
parse(FileName) ->
- {ok, InFile} = file:open(FileName, [read]),
- Acc = loop(InFile,[]),
- file:close(InFile),
- {ok,Parsed} = protobuffs_parser:parse(Acc),
+ {ok,Parsed} = protobuffs_compile:parse(FileName),
Parsed.
-
-loop(InFile,Acc) ->
- case io:request(InFile,{get_until,prompt,protobuffs_scanner,token,[1]}) of
- {ok,Token,_EndLine} ->
- loop(InFile,Acc ++ [Token]);
- {error,token} ->
- exit(scanning_error);
- {eof,_} ->
- Acc
- end.
-

0 comments on commit 9a35195

Please sign in to comment.