diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2024-02-23 07:08:18 +0100 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2024-02-23 07:08:18 +0100 |
commit | 5a9cdd3cc89507d4d74f8bded56ce5e037b3b56e (patch) | |
tree | 982ca2e7f9ac4e8c350dfb5c4f60bcfdfff5afaf /learn-you-some-erlang/ct/demo | |
parent | 05ae56e5e89abf2993f84e6d52b250131f247c35 (diff) | |
download | erlang-workshop-5a9cdd3cc89507d4d74f8bded56ce5e037b3b56e.tar.gz erlang-workshop-5a9cdd3cc89507d4d74f8bded56ce5e037b3b56e.tar.bz2 erlang-workshop-5a9cdd3cc89507d4d74f8bded56ce5e037b3b56e.tar.xz erlang-workshop-5a9cdd3cc89507d4d74f8bded56ce5e037b3b56e.zip |
wip
Diffstat (limited to 'learn-you-some-erlang/ct/demo')
-rw-r--r-- | learn-you-some-erlang/ct/demo/basic_SUITE.erl | 13 | ||||
-rw-r--r-- | learn-you-some-erlang/ct/demo/state_SUITE.erl | 24 |
2 files changed, 37 insertions, 0 deletions
diff --git a/learn-you-some-erlang/ct/demo/basic_SUITE.erl b/learn-you-some-erlang/ct/demo/basic_SUITE.erl new file mode 100644 index 0000000..566ff54 --- /dev/null +++ b/learn-you-some-erlang/ct/demo/basic_SUITE.erl @@ -0,0 +1,13 @@ +-module(basic_SUITE). +-include_lib("common_test/include/ct.hrl"). +-export([all/0]). +-export([test1/1, test2/1]). + +all() -> [test1,test2]. + +test1(_Config) -> + 1 = 1. + +test2(_Config) -> + A = 0, + 1/A. diff --git a/learn-you-some-erlang/ct/demo/state_SUITE.erl b/learn-you-some-erlang/ct/demo/state_SUITE.erl new file mode 100644 index 0000000..3ee0e5b --- /dev/null +++ b/learn-you-some-erlang/ct/demo/state_SUITE.erl @@ -0,0 +1,24 @@ +-module(state_SUITE). +-include_lib("common_test/include/ct.hrl"). + +-export([all/0, init_per_testcase/2, end_per_testcase/2]). +-export([ets_tests/1]). + +all() -> [ets_tests]. + +init_per_testcase(ets_tests, Config) -> + TabId = ets:new(account, [ordered_set, public]), + ets:insert(TabId, {andy, 2131}), + ets:insert(TabId, {david, 12}), + ets:insert(TabId, {steve, 12943752}), + [{table,TabId} | Config]. + +end_per_testcase(ets_tests, Config) -> + ets:delete(?config(table, Config)). + +ets_tests(Config) -> + TabId = ?config(table, Config), + [{david, 12}] = ets:lookup(TabId, david), + steve = ets:last(TabId), + true = ets:insert(TabId, {zachary, 99}), + zachary = ets:last(TabId). |