Permalink
Browse files

Added new file and test for negative parse of empty file

ros_parser
  • Loading branch information...
1 parent eb2a688 commit a37080c65f1f096759f00f13a1558fccd646d782 Gianfranco Alongi committed Feb 19, 2012
Showing with 15 additions and 1 deletion.
  1. +2 −1 One/Solution/Makefile
  2. +7 −0 One/Solution/src/ros_parser.erl
  3. +6 −0 One/Solution/test/ros_parser_tests.erl
View
@@ -4,4 +4,5 @@ all:
.PHONY: test
test:
- erl -pa ebin/ -eval 'eunit:test(ros_reader,[verbose]),init:stop().'
+ erl -pa ebin/ -eval 'eunit:test(ros_reader,[verbose]),\
+ eunit:test(ros_parser,[verbose]),init:stop().'
@@ -0,0 +1,7 @@
+-module(ros_parser).
+-export([parse/1]).
+
+-spec(parse(string()) -> {error,no_total}).
+parse("")-> {error,no_total}.
+
+
@@ -0,0 +1,6 @@
+-module(ros_parser_tests).
+-include_lib("eunit/include/eunit.hrl").
+
+ros_parse_empty_test() ->
+ Input = "",
+ ?assertMatch({error,no_total},ros_parser:parse(Input)).

0 comments on commit a37080c

Please sign in to comment.