aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLouis Pilfold <louis@lpil.uk>2019-12-16 19:11:48 +0000
committerLouis Pilfold <louis@lpil.uk>2019-12-16 19:11:48 +0000
commita3226660960fd25fe0fa1ebe36704d87cc537b42 (patch)
treea5185c9c72715e10e39c15baaa3bf4214a41987e
parentf59beba51db3fe1cb36dd8d1231c6e437f65a86a (diff)
downloadgleam_stdlib-a3226660960fd25fe0fa1ebe36704d87cc537b42.tar.gz
gleam_stdlib-a3226660960fd25fe0fa1ebe36704d87cc537b42.zip
Remove old generated files
-rw-r--r--gen/src/gleam@any.erl40
-rw-r--r--gen/test/gleam@any_test.erl147
2 files changed, 0 insertions, 187 deletions
diff --git a/gen/src/gleam@any.erl b/gen/src/gleam@any.erl
deleted file mode 100644
index 2cedd83..0000000
--- a/gen/src/gleam@any.erl
+++ /dev/null
@@ -1,40 +0,0 @@
--module(gleam@any).
--compile(no_auto_import).
-
--export([from/1, unsafe_coerce/1, string/1, int/1, float/1, atom/1, bool/1, thunk/1, list/2, field/2]).
-
-from(A) ->
- gleam_stdlib:identity(A).
-
-unsafe_coerce(A) ->
- gleam_stdlib:identity(A).
-
-string(A) ->
- gleam_stdlib:decode_string(A).
-
-int(A) ->
- gleam_stdlib:decode_int(A).
-
-float(A) ->
- gleam_stdlib:decode_float(A).
-
-atom(A) ->
- gleam_stdlib:decode_atom(A).
-
-bool(A) ->
- gleam_stdlib:decode_bool(A).
-
-thunk(A) ->
- gleam_stdlib:decode_thunk(A).
-
-list_any(A) ->
- gleam_stdlib:decode_list(A).
-
-list(Any, DecoderType) ->
- gleam@result:then(
- list_any(Any),
- fun(Capture1) -> gleam@list:traverse(Capture1, DecoderType) end
- ).
-
-field(A, B) ->
- gleam_stdlib:decode_field(A, B).
diff --git a/gen/test/gleam@any_test.erl b/gen/test/gleam@any_test.erl
deleted file mode 100644
index b7e472d..0000000
--- a/gen/test/gleam@any_test.erl
+++ /dev/null
@@ -1,147 +0,0 @@
--module(gleam@any_test).
--compile(no_auto_import).
-
--export([string_test/0, int_test/0, float_test/0, thunk_test/0, bool_test/0, atom_test/0, list_test/0, field_test/0]).
-
-string_test() ->
- gleam@expect:equal(gleam@any:string(gleam@any:from(<<"">>)), {ok, <<"">>}),
- gleam@expect:equal(
- gleam@any:string(gleam@any:from(<<"Hello">>)),
- {ok, <<"Hello">>}
- ),
- gleam@expect:equal(
- gleam@any:string(gleam@any:from(1)),
- {error, <<"Expected a String, got `1`">>}
- ),
- gleam@expect:equal(
- gleam@any:string(gleam@any:from([])),
- {error, <<"Expected a String, got `[]`">>}
- ).
-
-int_test() ->
- gleam@expect:equal(gleam@any:int(gleam@any:from(1)), {ok, 1}),
- gleam@expect:equal(gleam@any:int(gleam@any:from(2)), {ok, 2}),
- gleam@expect:equal(
- gleam@any:int(gleam@any:from(1.0)),
- {error, <<"Expected an Int, got `1.0`">>}
- ),
- gleam@expect:equal(
- gleam@any:int(gleam@any:from([])),
- {error, <<"Expected an Int, got `[]`">>}
- ).
-
-float_test() ->
- gleam@expect:equal(gleam@any:float(gleam@any:from(1.0)), {ok, 1.0}),
- gleam@expect:equal(gleam@any:float(gleam@any:from(2.2)), {ok, 2.2}),
- gleam@expect:equal(
- gleam@any:float(gleam@any:from(1)),
- {error, <<"Expected a Float, got `1`">>}
- ),
- gleam@expect:equal(
- gleam@any:float(gleam@any:from([])),
- {error, <<"Expected a Float, got `[]`">>}
- ).
-
-thunk_test() ->
- gleam@expect:is_ok(gleam@any:thunk(gleam@any:from(fun() -> 1 end))),
- gleam@expect:equal(
- gleam@result:map(
- gleam@any:thunk(gleam@any:from(fun() -> 1 end)),
- fun(F) -> F() end
- ),
- {ok, gleam@any:from(1)}
- ),
- gleam@expect:is_error(gleam@any:thunk(gleam@any:from(fun(X) -> X end))),
- gleam@expect:is_error(gleam@any:thunk(gleam@any:from(1))),
- gleam@expect:is_error(gleam@any:thunk(gleam@any:from([]))).
-
-bool_test() ->
- gleam@expect:equal(gleam@any:bool(gleam@any:from(true)), {ok, true}),
- gleam@expect:equal(gleam@any:bool(gleam@any:from(false)), {ok, false}),
- gleam@expect:equal(
- gleam@any:bool(gleam@any:from(1)),
- {error, <<"Expected a Bool, got `1`">>}
- ),
- gleam@expect:equal(
- gleam@any:bool(gleam@any:from([])),
- {error, <<"Expected a Bool, got `[]`">>}
- ).
-
-atom_test() ->
- gleam@expect:equal(
- gleam@any:atom(gleam@any:from(gleam@atom:create_from_string(<<"">>))),
- {ok, gleam@atom:create_from_string(<<"">>)}
- ),
- gleam@expect:equal(
- gleam@any:atom(gleam@any:from(gleam@atom:create_from_string(<<"ok">>))),
- {ok, gleam@atom:create_from_string(<<"ok">>)}
- ),
- gleam@expect:is_error(gleam@any:atom(gleam@any:from(1))),
- gleam@expect:is_error(gleam@any:atom(gleam@any:from([]))).
-
-list_test() ->
- gleam@expect:equal(
- gleam@any:list(gleam@any:from([]), fun gleam@any:string/1),
- {ok, []}
- ),
- gleam@expect:equal(
- gleam@any:list(gleam@any:from([]), fun gleam@any:int/1),
- {ok, []}
- ),
- gleam@expect:equal(
- gleam@any:list(gleam@any:from([1, 2, 3]), fun gleam@any:int/1),
- {ok, [1, 2, 3]}
- ),
- gleam@expect:equal(
- gleam@any:list(
- gleam@any:from([[1], [2], [3]]),
- fun(Capture1) -> gleam@any:list(Capture1, fun gleam@any:int/1) end
- ),
- {ok, [[1], [2], [3]]}
- ),
- gleam@expect:is_error(
- gleam@any:list(gleam@any:from(1), fun gleam@any:string/1)
- ),
- gleam@expect:is_error(
- gleam@any:list(gleam@any:from(1.0), fun gleam@any:int/1)
- ),
- gleam@expect:is_error(
- gleam@any:list(gleam@any:from([<<"">>]), fun gleam@any:int/1)
- ),
- gleam@expect:is_error(
- gleam@any:list(
- gleam@any:from(
- [gleam@any:from(1), gleam@any:from(<<"not an int">>)]
- ),
- fun gleam@any:int/1
- )
- ).
-
-field_test() ->
- {ok, OkAtom} = gleam@atom:from_string(<<"ok">>),
- {ok, ErrorAtom} = gleam@atom:from_string(<<"error">>),
- gleam@expect:equal(
- gleam@any:field(
- gleam@any:from(gleam@map:insert(gleam@map:new(), OkAtom, 1)),
- OkAtom
- ),
- {ok, gleam@any:from(1)}
- ),
- gleam@expect:equal(
- gleam@any:field(
- gleam@any:from(
- gleam@map:insert(
- gleam@map:insert(gleam@map:new(), OkAtom, 3),
- ErrorAtom,
- 1
- )
- ),
- OkAtom
- ),
- {ok, gleam@any:from(3)}
- ),
- gleam@expect:is_error(
- gleam@any:field(gleam@any:from(gleam@map:new()), OkAtom)
- ),
- gleam@expect:is_error(gleam@any:field(gleam@any:from(1), OkAtom)),
- gleam@expect:is_error(gleam@any:field(gleam@any:from([]), [])).