Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Provide a simple test framework for the unit test parses.

  • Loading branch information...
commit a71fa5c17be7ff8be1d91f41b66ef163fbb1d869 1 parent f888a11
@jlouis authored
Showing with 14 additions and 1 deletion.
  1. +4 −1 Makefile
  2. +10 −0 test/inet_time_tests.erl
View
5 Makefile
@@ -1,4 +1,4 @@
-.PHONY: all dialyzer clean
+.PHONY: all dialyzer clean eunit run
all:
rebar compile
@@ -9,5 +9,8 @@ dialyzer:
clean:
rebar clean
+eunit:
+ rebar eunit
+
run:
erl -pz ./ebin ./deps/ibrowse/ebin
View
10 test/inet_time_tests.erl
@@ -0,0 +1,10 @@
+-module(inet_time_tests).
+
+-include_lib("eunit/include/eunit.hrl").
+
+parse_test() ->
+ {ok, {{1984,2,29},{23,20,50,52},{'+',8,0}}} =
+ inet_time:parse("1984-02-29T23:20:50.52+8:0"),
+ {error, {invalid_date,{{1984,2,30},{23,20,50,52},{'+',8,0}}}} =
+ inet_time:parse("1984-02-30T23:20:50.52+8:0"),
+ done.
Please sign in to comment.
Something went wrong with that request. Please try again.