SlideShare a Scribd company logo
Eunit




         Richard Carlsson
            Kreditor Europe AB

   (Translated by SHIBUKAWA Yoshiki)
qD `YZ          [ = yoshiki@shibu.jp ]
Eunit /       xUnit        c

]          [8QLW   c            223 *
     `a c` c                c`    
    (UODQJ _ `        a   

(XQLW  IXQ (UODQJ          [   c`a=
      c        c           ^    ^
(XQLW  3           Z
c`                 a

.../myproject/
              Makefile

             src/
                 *.{erl,hrl}

             ebin/
                 *.beam
ca .` a

#      c Makefile
ERLC_FLAGS=
SOURCES=$(wildcard src/*.erl)
HEADERS=$(wildcard src/*.hrl)
OBJECTS=$(SOURCES:src/%.erl=ebin/%.beam)
all: $(OBJECTS) test
ebin/%.beam : src/%.erl $(HEADERS) Makefile
   erlc $(ERLC_FLAGS) -o ebin/ $
clean:
   -rm $(OBJECTS)
test:
   erl -noshell -pa ebin 
    -eval 'eunit:test(ebin,[verbose])' 
    -s init stop
c`           a      c        cb          c

%%     c= :   src/global.hrl

-include_lib(eunit/include/eunit.hrl).
`                 c

%%       c= :   src/empty.erl

-module(empty).

-include(global.hrl).


%%              `a           ^]

a_test() - ok.
c         `a

$ make
erlc -o ebin/ src/empty.erl
erl -noshell -pa ebin 
    -eval 'eunit:test(ebin,[verbose])' 
    -s init stop
====================== EUnit ======================
directory ebin
  empty:a_test (module 'empty')...ok
  [done in 0.007 s]
===================================================
  Test successful.
$
test                  _     `b a       ^^

1 empty:module_info(exports).
[{a_test,0},{test,0},{module_info,0},
{module_info,1}]
2 empty:test().
  Test passed.
ok
3 eunit:test(empty).
  Test passed.
ok
4 empty:a_test().
ok
5 eunit:test({empty,a_test}).
  Test passed.
ok
6
`a

ERLC_FLAGS=-DNOTEST         makefile            ^
   = `a                         c ^        Z

   # A simple Makefile
   ERLC_FLAGS=-DNOTEST
   ...

       `a                     a      ca
^=” make release”          ^           Z]
   release: clean
      $(MAKE) ERLC_FLAGS=$(ERLC_FLAGS) -DNOTEST
`a                        a               c

$ make
erlc -DNOTEST -o ebin/ src/empty.erl
erl -noshell -pa ebin 
    -eval 'eunit:test(ebin,[verbose])' 
    -s init stop
====================== EUnit ======================
directory ebin
  module 'empty'
  [done in 0.004 s]
  There were no tests to run.
$
`a           Z         Z          [

1 empty:module_info(exports).
[{module_info,0},{module_info,1}]
2 eunit:test(empty).
  There were no tests to run.
ok
3
_ca             `a                        
c  cb               c NOTEST
 c ^ =            _ca   `a    
    %%        : src/global.hrl

    -define(NOTEST, true).
    -include_lib(eunit/include/eunit.hrl).

   = TEST  makefile                 ^
= NOTEST    Z Z^

`a            ^        makefile          a        
^         Z^

        [=PZ ]                  Z[
`a              aV        
 `a         a       [ 

  eunit.hrl     cc ` `Z
  EUnit        `           Z ^
        c ^[ `a             EUnit 

            =    [     aZ          ^
  EUnit         _ `b a         2 ]
EUnit Z          Z    a        c

  B             = Z         c Z    Z ^
`a Z

%%        : src/fib.erl
-module(fib).
-export([f/1]).
-include(global.hrl).

f(0) - 1;
f(1) - 1;
f(N) when N  1 - f(N-1) * f(N-2).

f_test() -
    1 = f(0),
    1 = f(1),
    2 = f(2).
Badmatch Z             =         

====================== EUnit ======================
directory ebin
  fib: f_test (module 'fib')...*failed*
::error:{badmatch,1}
  in function fib:f_test/0

===================================================
  Failed: 1. Skipped: 0. Passed: 0.
`a               Z            ^

%%        : src/fib.erl
-module(fib).
-export([f/1]).
-include(global.hrl).

f(0) - 1;
f(1) - 1;
f(N) when N  1 - f(N-1) * f(N-2).

f0_test() - 1 = f(0).

f1_test() - 1 = f(1).

f2_test() - 2 = f(2).
Z                   Z         ]

====================== EUnit ======================
directory ebin
  module 'fib'
    fib: f0_test...ok
    fib: f1_test...ok
    fib: f2_test...*failed*
::error:{badmatch,1}
  in function fib:f2_test/0

    [done in 0.024 s]
===================================================
  Failed: 1. Skipped: 0. Passed: 0.
assert             =H Z

%%        : src/fib.erl
-module(fib).
-export([f/1]).
-include(global.hrl).

f(0) - 1;
f(1) - 1;
f(N) when N  1 - f(N-1) * f(N-2).

f0_test() - ?assertEqual(1, f(0)).

f1_test() - ?assertEqual(1, f(1)).

f2_test() - ?assertEqual(2, f(2)).
^ ^                 ]

====================== EUnit ======================
directory ebin
  module 'fib'
    fib: f0_test...ok
    fib: f1_test...ok
    fib: f2_test...*failed*
::error:{assertEqual_failed,[{module,fib},
                           {line,14},
                           {expression,f ( 2 )},
                           {expected,2},
                           {value,1}]}
  in function fib:'-f2_test/0-fun-0-'/1
!       assert

%% File: src/fib.erl
-module(fib).
-export([f/1]).
-include(global.hrl).

f(0) - 1;
f(1) - 1;
f(N) when N  1 - f(N-1) * f(N-2).

f_test() -
    ?assertEqual(1,   f(0)),
    ?assertEqual(1,   f(1)),
    ?assertEqual(2,   f(2)),
    ?assertEqual(3,   f(3)).
*%                         ]

====================== EUnit ======================
directory ebin
  fib: f_test (module 'fib')...*failed*
::error:{assertEqual_failed,[{module,fib},
                           {line,13},
                           {expression,f ( 2 )},
                           {expected,2},
                           {value,1}]}
  in function fib:'-f_test/0-fun-2-'/1
  in call from fib:f_test/0
`    ac                               ^

%%        : src/fib.erl
-module(fib).
-export([f/1]).
-include(global.hrl).

f(0) - 1;
f(1) - 1;
f(N) when N  1 - f(N-1) * f(N-2).

f_test_() -
    [?_assertEqual(1,   f(0)),
     ?_assertEqual(1,   f(1)),
     ?_assertEqual(2,   f(2)),
     ?_assertEqual(3,   f(3))].
^[ `a` a                          ]

    fib:11: f_test_...ok
    fib:12: f_test_...ok
    fib:13: f_test_...*failed*
::error:{assertEqual_failed,[{module,fib},
                           {line,13},
                           {expression,f ( 2 )},
                           {expected,2},
                           {value,1}]}
  in function fib:'-f_test_/0-fun-4-'/1
    fib:14: f_test_...*failed*
::error:{assertEqual_failed,[{module,fib},
                           {line,14},
                           {expression,f ( 3 )},
                           {expected,3},
                           {value,1}]}
  in function fib:'-f_test_/0-fun-6-'/1
_c           `a          `           ^ 

%%        : src/fib.erl
-module(fib).
-export([f/1]).
-include(global.hrl).

f(0) - 1;
f(1) - 1;
f(N) when N  1 - f(N-1) + f(N-2).

f_test_() -
  [?_assertEqual(1, f(0)),
   ?_assertEqual(1, f(1)),
   ?_assertEqual(2, f(2)),
   ?_assertError(function_clause, f(-1)),
   ?_assert(f(31) =:= 2178309)].
]Z Z] [=                         S

====================== EUnit ======================
directory ebin
  module 'fib'
    fib:11: f_test_...ok
    fib:12: f_test_...ok
    fib:13: f_test_...ok
    fib:14: f_test_...ok
    fib:15: f_test_...[0.394 s] ok
    [done in 0.432 s]
===================================================
  All 5 tests passed.
`a         `        c              ^

%%        : src/fib_tests.erl
-module(fib_tests).
-include(global.hrl).

f_test_() -
  [?_assertEqual(1, fib:f(0)),
   ?_assertEqual(1, fib:f(1)),
   ?_assertEqual(2, fib:f(2)),
   ?_assertError(function_clause, fib:f(-1)),
   ?_assert(fib:f(31) =:= 2178309)].
^]

1 eunit:test(fib, [verbose]).
====================== EUnit ======================
module 'fib'
  module 'fib_tests'
    fib_tests:6: f_test_...ok
    fib_tests:7: f_test_...ok
    fib_tests:8: f_test_...ok
    fib_tests:9: f_test_...ok
    fib_tests:11: f_test_...[0.405 s] ok
    [done in 0.442 s]
  [done in 0.442 s]
===================================================
  All 5 tests passed.
c c` 

%%        : src/fib.erl
-module(fib).
-export([f/1, g/1]).

f(0) - 1;
f(1) - 1;
f(N) when N  1 - f(N-1) + f(N-2).


g(N) when N = 0 - g(N, 0, 1).

g(0, _F1, F2) - F2;
g(N, F1, F2) - g(N - 1, F2, F1 + F2).
U                      ^ `aZ

%%        : src/fib_tests.erl
-module(fib_tests).
-include(global.hrl).

f_test_() -
  [...].

g_test_() -
    [?_assertError(function_clause, fib:g(-1)),
     ?_assertEqual(fib:f(0), fib:g(0)),
     ?_assertEqual(fib:f(1), fib:g(1)),
     ?_assertEqual(fib:f(2), fib:g(2)),
     ?_assertEqual(fib:f(17), fib:g(17)),
     ?_assertEqual(fib:f(31), fib:g(31))].
YZ `a ]

====================== EUnit ======================
module 'fib'
  module 'fib_tests'
    fib_tests:6: f_test_...ok
    fib_tests:7: f_test_...ok
    fib_tests:8: f_test_...ok
    fib_tests:9: f_test_...ok
    fib_tests:11: f_test_...[0.397 s] ok
    fib_tests:14: g_test_...ok
    fib_tests:16: g_test_...ok
    fib_tests:17: g_test_...ok
    fib_tests:18: g_test_...ok
    fib_tests:19: g_test_...ok
    fib_tests:20: g_test_...[0.425 s] ok
===================================================
  All 11 tests passed.
`a                 Z] Z

%%        : src/fib_tests.erl
-module(fib_tests).
-include(global.hrl).

f_test_() -
  [...].

g_test_() -
    [?_assertEqual(fib:f(N), fib:g(N))
     || N - lists:seq(0,33)].

g_error_test() -
    ?assertError(function_clause, fib:g(-1)).
ZZZ                 ]      Z

    fib_tests:17: g_test_...ok
    fib_tests:17: g_test_...ok
    ...
    fib_tests:17: g_test_...[0.001 s] ok
    fib_tests:17: g_test_...[0.002 s] ok
    fib_tests:17: g_test_...[0.003 s] ok
    fib_tests:17: g_test_...[0.005 s] ok
    fib_tests:17: g_test_...[0.008 s] ok
    fib_tests:17: g_test_...[0.013 s] ok
    fib_tests:17: g_test_...[0.021 s] ok
    ...
    fib_tests:17: g_test_...[0.566 s] ok
    fib_tests:17: g_test_...[0.939 s] ok
    [done in 3.148 s]
===================================================
  All 40 tests passed.
`a               Z
    ZZZ^                   ^     Z]
                     ^   ^][
*= ZZ^                  ` _        ]
        a       .(   `c   

        c`a= ]c`a=a ]c`a

c               [ `a        `    Z Z
        [              ^   [[ =           
2        ^
c            ?E                        ]

%%       : src/fib_tests.erl
-module(fib_tests).
-include(global.hrl).

...

g_test_() -
    {inparallel,
     [?_assertEqual(fib:f(N), fib:g(N))
      || N - lists:seq(0,33)]
    }.

...
=] ]                        [ 

    fib_tests:17: g_test_...ok
    fib_tests:17: g_test_...ok
    ...
    fib_tests:17: g_test_...[0.001 s] ok
    fib_tests:17: g_test_...ok
    fib_tests:17: g_test_...[0.003 s] ok
    fib_tests:17: g_test_...[0.011 s] ok
    fib_tests:17: g_test_...[0.015 s] ok
    fib_tests:17: g_test_...[0.023 s] ok
    fib_tests:17: g_test_...[0.036 s] ok
    ...
    fib_tests:17: g_test_...[1.378 s] ok
    fib_tests:17: g_test_...[1.085 s] ok
    [done in 1.853 s]
===================================================
  All 40 tests passed.
-                                   c``

%%        : src/adder.erl
-module(adder).
-export([start/0, stop/1, add/2]).
start() - spawn(fun server/0).
stop(Pid) - Pid ! stop.
add(D, Pid) -
  Pid ! {add, D, self()},
  receive {adder, N} - N end.

server() - server(0).
server(N) -
  receive
    {add, D, From} -
        From ! {adder, N + D},   server(N + D);
    stop - ok
  end.
n          `         |

%%        : src/adder_tests.erl
-module(adder_tests).
-include(global.hrl).

named_test_() -
  {setup,
   fun()- P=adder:start(), register(srv, P), P end,
   fun adder:stop/1,
   [?_assertEqual(0, adder:add(0, srv)),
    ?_assertEqual(1, adder:add(1, srv)),
    ?_assertEqual(11, adder:add(10, srv)),
    ?_assertEqual(6, adder:add(-5, srv)),
    ?_assertEqual(-5, adder:add(-11, srv)),
    ?_assertEqual(0, adder:add(-adder:add(0, srv),
                               srv))]
  }.
`a                 `         `

...

anonymous_test_() -
  {setup, fun adder:start/0, fun adder:stop/1,
   fun (Srv) -
    {inorder,    %%
     [?_assertEqual(0, adder:add(0, Srv)),
                       W          U      W

      ?_assertEqual(1, adder:add(1, Srv)),
      ?_assertEqual(11, adder:add(10, Srv)),
      ?_assertEqual(6, adder:add(-5, Srv)),
      ?_assertEqual(-5, adder:add(-11, Srv)),
      ?_assertEqual(0, adder:add(-adder:add(0, Srv),
                                 Srv))]
    }
   end}.
Z Z assert              -            `a

anonymous_test_() -
  {setup, fun adder:start/0, fun adder:stop/1,
   fun (Srv) -
    [?_test(
      begin
       ?assertEqual(0, adder:add(0, Srv)),
       ?assertEqual(1, adder:add(1, Srv)),
       ?assertEqual(11, adder:add(10, Srv)),
       ?assertEqual(6, adder:add(-5, Srv)),
       ?assertEqual(-5, adder:add(-11, Srv)),
       ?assertEqual(0, adder:add(-adder:add(0, Srv),
                                 Srv))
      end)]
   end}.
`a                 b 8

anonymous_test_() -
  {setup, fun adder:start/0, fun adder:stop/1,
   fun (Srv) -
    [?_test(
      begin
       assert_add( 0, 0, Srv),
       ...
       assert_add(-11, -5, Srv),
       assert_add(-adder:add(0, Srv), 0, Srv)
      end
     )]
   end}.

assert_add(D, N, Srv) -
  ?assertEqual(N, adder:add(D, Srv)).
`a                     F

anonymous_test_() -
  {setup, fun adder:start/0, fun adder:stop/1,
   fun (Srv) -
    {with, Srv,
      [fun first_subtest/1, ...]
    }
   end}.

first_subtest(Srv) -
  assert_add( 0, 0, Srv),
  ...
  assert_add(-11, -5, Srv),
  assert_add(-adder:add(0, Srv), 0, Srv).

assert_add(D, N, Srv) -
  ?assertEqual(N, adder:add(D, Srv)).
'with'    '        [        `          a

anonymous_test_() -
  {setup, fun adder:start/0, fun adder:stop/1,
    {with,
      [fun first_subtest/1,
       ...]
    }
  }.

first_subtest(Srv) -
  assert_add( 0, 0, Srv),
  ...
  assert_add(-11, -5, Srv),
  assert_add(-adder:add(0, Srv), 0, Srv).

assert_add(D, N, Srv) -
  ?assertEqual(N, adder:add(D, Srv)).
`a                a Z                y       [
 `a         a        a       Y

        a !          
                   [ '     ^      [
    `a       a c            c      [
(UODQJ           Z       ^          ^ 

         ^^        
S          F
  
S        a -ifdef(TEST)                    c
(8QLW   a       c

            
S ^         [Z       -       ]
2.1  
EUNIT    `              (     “[verbose]”)

A cb a `                      9Z
             a                   [ 
  cb a                _ a[                 `    c
  Maven (“surefire”)        b a
    `a` a                  ac       `           
                       ZZ[^             
             ^` ac              Z       ^           [
      ^[                   '         8   [
] Z

More Related Content

What's hot

Unbreakable: The Craft of Code
Unbreakable: The Craft of CodeUnbreakable: The Craft of Code
Unbreakable: The Craft of Code
Joe Morgan
 
Meck
MeckMeck
Building Real Time Systems on MongoDB Using the Oplog at Stripe
Building Real Time Systems on MongoDB Using the Oplog at StripeBuilding Real Time Systems on MongoDB Using the Oplog at Stripe
Building Real Time Systems on MongoDB Using the Oplog at Stripe
Stripe
 
20190330 immutable data
20190330 immutable data20190330 immutable data
20190330 immutable data
Chiwon Song
 
Building Real Time Systems on MongoDB Using the Oplog at Stripe
Building Real Time Systems on MongoDB Using the Oplog at StripeBuilding Real Time Systems on MongoDB Using the Oplog at Stripe
Building Real Time Systems on MongoDB Using the Oplog at Stripe
MongoDB
 
20180721 code defragment
20180721 code defragment20180721 code defragment
20180721 code defragment
Chiwon Song
 
Going Loopy - Adventures in Iteration with Google Go
Going Loopy - Adventures in Iteration with Google GoGoing Loopy - Adventures in Iteration with Google Go
Going Loopy - Adventures in Iteration with Google Go
Eleanor McHugh
 
20180310 functional programming
20180310 functional programming20180310 functional programming
20180310 functional programming
Chiwon Song
 
Comparative Genomics with GMOD and BioPerl
Comparative Genomics with GMOD and BioPerlComparative Genomics with GMOD and BioPerl
Comparative Genomics with GMOD and BioPerl
Jason Stajich
 
Elixir cheatsheet
Elixir cheatsheetElixir cheatsheet
Elixir cheatsheet
Héla Ben Khalfallah
 
20181020 advanced higher-order function
20181020 advanced higher-order function20181020 advanced higher-order function
20181020 advanced higher-order function
Chiwon Song
 
Calvix python
Calvix pythonCalvix python
Calvix python
nicolas_paris
 
Async code on kotlin: rx java or/and coroutines - Kotlin Night Turin
Async code on kotlin: rx java or/and coroutines - Kotlin Night TurinAsync code on kotlin: rx java or/and coroutines - Kotlin Night Turin
Async code on kotlin: rx java or/and coroutines - Kotlin Night Turin
Fabio Collini
 
Extreme JavaScript Performance
Extreme JavaScript PerformanceExtreme JavaScript Performance
Extreme JavaScript Performance
Thomas Fuchs
 
PHP tips and tricks
PHP tips and tricks PHP tips and tricks
PHP tips and tricks
Damien Seguy
 
Python for High School Programmers
Python for High School ProgrammersPython for High School Programmers
Python for High School Programmers
Siva Arunachalam
 
Chapter 2: R tutorial Handbook for Data Science and Machine Learning Practiti...
Chapter 2: R tutorial Handbook for Data Science and Machine Learning Practiti...Chapter 2: R tutorial Handbook for Data Science and Machine Learning Practiti...
Chapter 2: R tutorial Handbook for Data Science and Machine Learning Practiti...
Raman Kannan
 
8時間耐久CakePHP2 勉強会
8時間耐久CakePHP2 勉強会8時間耐久CakePHP2 勉強会
8時間耐久CakePHP2 勉強会
Yusuke Ando
 
20191116 custom operators in swift
20191116 custom operators in swift20191116 custom operators in swift
20191116 custom operators in swift
Chiwon Song
 
Building Real Time Systems on MongoDB Using the Oplog at Stripe
Building Real Time Systems on MongoDB Using the Oplog at StripeBuilding Real Time Systems on MongoDB Using the Oplog at Stripe
Building Real Time Systems on MongoDB Using the Oplog at Stripe
MongoDB
 

What's hot (20)

Unbreakable: The Craft of Code
Unbreakable: The Craft of CodeUnbreakable: The Craft of Code
Unbreakable: The Craft of Code
 
Meck
MeckMeck
Meck
 
Building Real Time Systems on MongoDB Using the Oplog at Stripe
Building Real Time Systems on MongoDB Using the Oplog at StripeBuilding Real Time Systems on MongoDB Using the Oplog at Stripe
Building Real Time Systems on MongoDB Using the Oplog at Stripe
 
20190330 immutable data
20190330 immutable data20190330 immutable data
20190330 immutable data
 
Building Real Time Systems on MongoDB Using the Oplog at Stripe
Building Real Time Systems on MongoDB Using the Oplog at StripeBuilding Real Time Systems on MongoDB Using the Oplog at Stripe
Building Real Time Systems on MongoDB Using the Oplog at Stripe
 
20180721 code defragment
20180721 code defragment20180721 code defragment
20180721 code defragment
 
Going Loopy - Adventures in Iteration with Google Go
Going Loopy - Adventures in Iteration with Google GoGoing Loopy - Adventures in Iteration with Google Go
Going Loopy - Adventures in Iteration with Google Go
 
20180310 functional programming
20180310 functional programming20180310 functional programming
20180310 functional programming
 
Comparative Genomics with GMOD and BioPerl
Comparative Genomics with GMOD and BioPerlComparative Genomics with GMOD and BioPerl
Comparative Genomics with GMOD and BioPerl
 
Elixir cheatsheet
Elixir cheatsheetElixir cheatsheet
Elixir cheatsheet
 
20181020 advanced higher-order function
20181020 advanced higher-order function20181020 advanced higher-order function
20181020 advanced higher-order function
 
Calvix python
Calvix pythonCalvix python
Calvix python
 
Async code on kotlin: rx java or/and coroutines - Kotlin Night Turin
Async code on kotlin: rx java or/and coroutines - Kotlin Night TurinAsync code on kotlin: rx java or/and coroutines - Kotlin Night Turin
Async code on kotlin: rx java or/and coroutines - Kotlin Night Turin
 
Extreme JavaScript Performance
Extreme JavaScript PerformanceExtreme JavaScript Performance
Extreme JavaScript Performance
 
PHP tips and tricks
PHP tips and tricks PHP tips and tricks
PHP tips and tricks
 
Python for High School Programmers
Python for High School ProgrammersPython for High School Programmers
Python for High School Programmers
 
Chapter 2: R tutorial Handbook for Data Science and Machine Learning Practiti...
Chapter 2: R tutorial Handbook for Data Science and Machine Learning Practiti...Chapter 2: R tutorial Handbook for Data Science and Machine Learning Practiti...
Chapter 2: R tutorial Handbook for Data Science and Machine Learning Practiti...
 
8時間耐久CakePHP2 勉強会
8時間耐久CakePHP2 勉強会8時間耐久CakePHP2 勉強会
8時間耐久CakePHP2 勉強会
 
20191116 custom operators in swift
20191116 custom operators in swift20191116 custom operators in swift
20191116 custom operators in swift
 
Building Real Time Systems on MongoDB Using the Oplog at Stripe
Building Real Time Systems on MongoDB Using the Oplog at StripeBuilding Real Time Systems on MongoDB Using the Oplog at Stripe
Building Real Time Systems on MongoDB Using the Oplog at Stripe
 

Viewers also liked

Go & multi platform GUI Trials and Errors
Go & multi platform GUI Trials and ErrorsGo & multi platform GUI Trials and Errors
Go & multi platform GUI Trials and Errors
Yoshiki Shibukawa
 
Erlang Developments: The Good, The Bad and The Ugly
Erlang Developments: The Good, The Bad and The UglyErlang Developments: The Good, The Bad and The Ugly
Erlang Developments: The Good, The Bad and The Ugly
enriquepazperez
 
Mithril
MithrilMithril
アンラーニング
アンラーニングアンラーニング
アンラーニング
Yoshiki Shibukawa
 
Excelの話
Excelの話Excelの話
Excelの話
Yoshiki Shibukawa
 
FINAL FANTASY Record Keeperを支えたGolang
FINAL FANTASY Record Keeperを支えたGolangFINAL FANTASY Record Keeperを支えたGolang
FINAL FANTASY Record Keeperを支えたGolang
Yoshiki Shibukawa
 

Viewers also liked (6)

Go & multi platform GUI Trials and Errors
Go & multi platform GUI Trials and ErrorsGo & multi platform GUI Trials and Errors
Go & multi platform GUI Trials and Errors
 
Erlang Developments: The Good, The Bad and The Ugly
Erlang Developments: The Good, The Bad and The UglyErlang Developments: The Good, The Bad and The Ugly
Erlang Developments: The Good, The Bad and The Ugly
 
Mithril
MithrilMithril
Mithril
 
アンラーニング
アンラーニングアンラーニング
アンラーニング
 
Excelの話
Excelの話Excelの話
Excelの話
 
FINAL FANTASY Record Keeperを支えたGolang
FINAL FANTASY Record Keeperを支えたGolangFINAL FANTASY Record Keeperを支えたGolang
FINAL FANTASY Record Keeperを支えたGolang
 

Similar to EUnit in Practice(Japanese)

EcmaScript 6
EcmaScript 6 EcmaScript 6
EcmaScript 6
Manoj Kumar
 
From Javascript To Haskell
From Javascript To HaskellFrom Javascript To Haskell
From Javascript To Haskell
ujihisa
 
Hacking ansible
Hacking ansibleHacking ansible
Hacking ansible
bcoca
 
Testing My Patience
Testing My PatienceTesting My Patience
Testing My Patience
Adam Lowry
 
Implementing the IO Monad in Scala
Implementing the IO Monad in ScalaImplementing the IO Monad in Scala
Implementing the IO Monad in Scala
Hermann Hueck
 
Introducing to Asynchronous Programming
Introducing to Asynchronous  ProgrammingIntroducing to Asynchronous  Programming
Introducing to Asynchronous Programming
Александр Федоров
 
ES6 PPT FOR 2016
ES6 PPT FOR 2016ES6 PPT FOR 2016
ES6 PPT FOR 2016
Manoj Kumar
 
JavaScript for PHP developers
JavaScript for PHP developersJavaScript for PHP developers
JavaScript for PHP developers
Stoyan Stefanov
 
Frege is a Haskell for the JVM
Frege is a Haskell for the JVMFrege is a Haskell for the JVM
Frege is a Haskell for the JVM
jwausle
 
An introduction to Google test framework
An introduction to Google test frameworkAn introduction to Google test framework
An introduction to Google test framework
Abner Chih Yi Huang
 
Jsphp 110312161301-phpapp02
Jsphp 110312161301-phpapp02Jsphp 110312161301-phpapp02
Jsphp 110312161301-phpapp02
Seri Moth
 
ES2015 workflows
ES2015 workflowsES2015 workflows
ES2015 workflows
Jarrod Overson
 
스위프트를 여행하는 히치하이커를 위한 스타일 안내
스위프트를 여행하는 히치하이커를 위한 스타일 안내스위프트를 여행하는 히치하이커를 위한 스타일 안내
스위프트를 여행하는 히치하이커를 위한 스타일 안내
Jung Kim
 
Consider the following C code snippet C codevoid setArray(int.pdf
Consider the following C code snippet C codevoid setArray(int.pdfConsider the following C code snippet C codevoid setArray(int.pdf
Consider the following C code snippet C codevoid setArray(int.pdf
arihantmum
 
Say It With Javascript
Say It With JavascriptSay It With Javascript
Say It With Javascript
Giovanni Scerra ☃
 
Javascript
JavascriptJavascript
Javascript
Vlad Ifrim
 
Haskellで学ぶ関数型言語
Haskellで学ぶ関数型言語Haskellで学ぶ関数型言語
Haskellで学ぶ関数型言語
ikdysfm
 
Gevent what's the point
Gevent what's the pointGevent what's the point
Gevent what's the point
seanmcq
 
Being functional in PHP
Being functional in PHPBeing functional in PHP
Being functional in PHP
David de Boer
 
Workshop 10: ECMAScript 6
Workshop 10: ECMAScript 6Workshop 10: ECMAScript 6
Workshop 10: ECMAScript 6
Visual Engineering
 

Similar to EUnit in Practice(Japanese) (20)

EcmaScript 6
EcmaScript 6 EcmaScript 6
EcmaScript 6
 
From Javascript To Haskell
From Javascript To HaskellFrom Javascript To Haskell
From Javascript To Haskell
 
Hacking ansible
Hacking ansibleHacking ansible
Hacking ansible
 
Testing My Patience
Testing My PatienceTesting My Patience
Testing My Patience
 
Implementing the IO Monad in Scala
Implementing the IO Monad in ScalaImplementing the IO Monad in Scala
Implementing the IO Monad in Scala
 
Introducing to Asynchronous Programming
Introducing to Asynchronous  ProgrammingIntroducing to Asynchronous  Programming
Introducing to Asynchronous Programming
 
ES6 PPT FOR 2016
ES6 PPT FOR 2016ES6 PPT FOR 2016
ES6 PPT FOR 2016
 
JavaScript for PHP developers
JavaScript for PHP developersJavaScript for PHP developers
JavaScript for PHP developers
 
Frege is a Haskell for the JVM
Frege is a Haskell for the JVMFrege is a Haskell for the JVM
Frege is a Haskell for the JVM
 
An introduction to Google test framework
An introduction to Google test frameworkAn introduction to Google test framework
An introduction to Google test framework
 
Jsphp 110312161301-phpapp02
Jsphp 110312161301-phpapp02Jsphp 110312161301-phpapp02
Jsphp 110312161301-phpapp02
 
ES2015 workflows
ES2015 workflowsES2015 workflows
ES2015 workflows
 
스위프트를 여행하는 히치하이커를 위한 스타일 안내
스위프트를 여행하는 히치하이커를 위한 스타일 안내스위프트를 여행하는 히치하이커를 위한 스타일 안내
스위프트를 여행하는 히치하이커를 위한 스타일 안내
 
Consider the following C code snippet C codevoid setArray(int.pdf
Consider the following C code snippet C codevoid setArray(int.pdfConsider the following C code snippet C codevoid setArray(int.pdf
Consider the following C code snippet C codevoid setArray(int.pdf
 
Say It With Javascript
Say It With JavascriptSay It With Javascript
Say It With Javascript
 
Javascript
JavascriptJavascript
Javascript
 
Haskellで学ぶ関数型言語
Haskellで学ぶ関数型言語Haskellで学ぶ関数型言語
Haskellで学ぶ関数型言語
 
Gevent what's the point
Gevent what's the pointGevent what's the point
Gevent what's the point
 
Being functional in PHP
Being functional in PHPBeing functional in PHP
Being functional in PHP
 
Workshop 10: ECMAScript 6
Workshop 10: ECMAScript 6Workshop 10: ECMAScript 6
Workshop 10: ECMAScript 6
 

More from Yoshiki Shibukawa

技術書執筆のススメ 〜Only1なエンジニアになるためのセルフブランディング〜の発表資料
技術書執筆のススメ 〜Only1なエンジニアになるためのセルフブランディング〜の発表資料技術書執筆のススメ 〜Only1なエンジニアになるためのセルフブランディング〜の発表資料
技術書執筆のススメ 〜Only1なエンジニアになるためのセルフブランディング〜の発表資料
Yoshiki Shibukawa
 
GO本執筆者が語る、2064年もITで仕事し続けるためのキャリアプランの発表資料
GO本執筆者が語る、2064年もITで仕事し続けるためのキャリアプランの発表資料GO本執筆者が語る、2064年もITで仕事し続けるためのキャリアプランの発表資料
GO本執筆者が語る、2064年もITで仕事し続けるためのキャリアプランの発表資料
Yoshiki Shibukawa
 
Golang tokyo #7 qtpm
Golang tokyo #7 qtpmGolang tokyo #7 qtpm
Golang tokyo #7 qtpm
Yoshiki Shibukawa
 
Chunked encoding を使った高速化の考察
Chunked encoding を使った高速化の考察Chunked encoding を使った高速化の考察
Chunked encoding を使った高速化の考察
Yoshiki Shibukawa
 
東京Node学園 今できる通信高速化にトライしてみた
東京Node学園 今できる通信高速化にトライしてみた東京Node学園 今できる通信高速化にトライしてみた
東京Node学園 今できる通信高速化にトライしてみた
Yoshiki Shibukawa
 
Oktavia全文検索エンジン - SphinxCon JP 2014
Oktavia全文検索エンジン - SphinxCon JP 2014Oktavia全文検索エンジン - SphinxCon JP 2014
Oktavia全文検索エンジン - SphinxCon JP 2014
Yoshiki Shibukawa
 
Oktavia Search Engine - pyconjp2014
Oktavia Search Engine - pyconjp2014Oktavia Search Engine - pyconjp2014
Oktavia Search Engine - pyconjp2014
Yoshiki Shibukawa
 
大規模JavaScript開発
大規模JavaScript開発大規模JavaScript開発
大規模JavaScript開発
Yoshiki Shibukawa
 
Xpjug基調lt2011
Xpjug基調lt2011Xpjug基調lt2011
Xpjug基調lt2011
Yoshiki Shibukawa
 
Expert JavaScript Programming
Expert JavaScript ProgrammingExpert JavaScript Programming
Expert JavaScript Programming
Yoshiki Shibukawa
 
JavaScriptゲーム制作勉強会
JavaScriptゲーム制作勉強会JavaScriptゲーム制作勉強会
JavaScriptゲーム制作勉強会
Yoshiki Shibukawa
 
Pomodoro technique
Pomodoro techniquePomodoro technique
Pomodoro technique
Yoshiki Shibukawa
 
ドキュメントを作りたくなってしまう魔法のツール「Sphinx」
ドキュメントを作りたくなってしまう魔法のツール「Sphinx」ドキュメントを作りたくなってしまう魔法のツール「Sphinx」
ドキュメントを作りたくなってしまう魔法のツール「Sphinx」Yoshiki Shibukawa
 
Bitbucket&mercurial
Bitbucket&mercurialBitbucket&mercurial
Bitbucket&mercurial
Yoshiki Shibukawa
 
つまみぐい勉強法。その後。
つまみぐい勉強法。その後。つまみぐい勉強法。その後。
つまみぐい勉強法。その後。Yoshiki Shibukawa
 
Sphinx Tutorial at BPStudy#30
Sphinx Tutorial at BPStudy#30Sphinx Tutorial at BPStudy#30
Sphinx Tutorial at BPStudy#30
Yoshiki Shibukawa
 
Who is the person whom the IT engineers should learn next to Alexander?
Who is the person whom the IT engineers should learn next to Alexander?Who is the person whom the IT engineers should learn next to Alexander?
Who is the person whom the IT engineers should learn next to Alexander?
Yoshiki Shibukawa
 
1日~1週間でOSSに貢献する方法
1日~1週間でOSSに貢献する方法1日~1週間でOSSに貢献する方法
1日~1週間でOSSに貢献する方法
Yoshiki Shibukawa
 
儲かるドキュメント
儲かるドキュメント儲かるドキュメント
儲かるドキュメント
Yoshiki Shibukawa
 

More from Yoshiki Shibukawa (20)

技術書執筆のススメ 〜Only1なエンジニアになるためのセルフブランディング〜の発表資料
技術書執筆のススメ 〜Only1なエンジニアになるためのセルフブランディング〜の発表資料技術書執筆のススメ 〜Only1なエンジニアになるためのセルフブランディング〜の発表資料
技術書執筆のススメ 〜Only1なエンジニアになるためのセルフブランディング〜の発表資料
 
GO本執筆者が語る、2064年もITで仕事し続けるためのキャリアプランの発表資料
GO本執筆者が語る、2064年もITで仕事し続けるためのキャリアプランの発表資料GO本執筆者が語る、2064年もITで仕事し続けるためのキャリアプランの発表資料
GO本執筆者が語る、2064年もITで仕事し続けるためのキャリアプランの発表資料
 
Golang tokyo #7 qtpm
Golang tokyo #7 qtpmGolang tokyo #7 qtpm
Golang tokyo #7 qtpm
 
Chunked encoding を使った高速化の考察
Chunked encoding を使った高速化の考察Chunked encoding を使った高速化の考察
Chunked encoding を使った高速化の考察
 
東京Node学園 今できる通信高速化にトライしてみた
東京Node学園 今できる通信高速化にトライしてみた東京Node学園 今できる通信高速化にトライしてみた
東京Node学園 今できる通信高速化にトライしてみた
 
Oktavia全文検索エンジン - SphinxCon JP 2014
Oktavia全文検索エンジン - SphinxCon JP 2014Oktavia全文検索エンジン - SphinxCon JP 2014
Oktavia全文検索エンジン - SphinxCon JP 2014
 
Oktavia Search Engine - pyconjp2014
Oktavia Search Engine - pyconjp2014Oktavia Search Engine - pyconjp2014
Oktavia Search Engine - pyconjp2014
 
大規模JavaScript開発
大規模JavaScript開発大規模JavaScript開発
大規模JavaScript開発
 
Xpjug基調lt2011
Xpjug基調lt2011Xpjug基調lt2011
Xpjug基調lt2011
 
Expert JavaScript Programming
Expert JavaScript ProgrammingExpert JavaScript Programming
Expert JavaScript Programming
 
JavaScriptゲーム制作勉強会
JavaScriptゲーム制作勉強会JavaScriptゲーム制作勉強会
JavaScriptゲーム制作勉強会
 
Pomodoro technique
Pomodoro techniquePomodoro technique
Pomodoro technique
 
ドキュメントを作りたくなってしまう魔法のツール「Sphinx」
ドキュメントを作りたくなってしまう魔法のツール「Sphinx」ドキュメントを作りたくなってしまう魔法のツール「Sphinx」
ドキュメントを作りたくなってしまう魔法のツール「Sphinx」
 
Bitbucket&mercurial
Bitbucket&mercurialBitbucket&mercurial
Bitbucket&mercurial
 
つまみぐい勉強法。その後。
つまみぐい勉強法。その後。つまみぐい勉強法。その後。
つまみぐい勉強法。その後。
 
Erlang and I and Sphinx.
Erlang and I and Sphinx.Erlang and I and Sphinx.
Erlang and I and Sphinx.
 
Sphinx Tutorial at BPStudy#30
Sphinx Tutorial at BPStudy#30Sphinx Tutorial at BPStudy#30
Sphinx Tutorial at BPStudy#30
 
Who is the person whom the IT engineers should learn next to Alexander?
Who is the person whom the IT engineers should learn next to Alexander?Who is the person whom the IT engineers should learn next to Alexander?
Who is the person whom the IT engineers should learn next to Alexander?
 
1日~1週間でOSSに貢献する方法
1日~1週間でOSSに貢献する方法1日~1週間でOSSに貢献する方法
1日~1週間でOSSに貢献する方法
 
儲かるドキュメント
儲かるドキュメント儲かるドキュメント
儲かるドキュメント
 

Recently uploaded

Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 

Recently uploaded (20)

Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 

EUnit in Practice(Japanese)

  • 1. Eunit Richard Carlsson Kreditor Europe AB (Translated by SHIBUKAWA Yoshiki) qD `YZ [ = yoshiki@shibu.jp ]
  • 2. Eunit / xUnit c ] [8QLW c 223 * `a c` c c` (UODQJ _ ` a (XQLW IXQ (UODQJ [ c`a= c c ^ ^ (XQLW 3 Z
  • 3. c` a .../myproject/ Makefile src/ *.{erl,hrl} ebin/ *.beam
  • 4. ca .` a # c Makefile ERLC_FLAGS= SOURCES=$(wildcard src/*.erl) HEADERS=$(wildcard src/*.hrl) OBJECTS=$(SOURCES:src/%.erl=ebin/%.beam) all: $(OBJECTS) test ebin/%.beam : src/%.erl $(HEADERS) Makefile erlc $(ERLC_FLAGS) -o ebin/ $ clean: -rm $(OBJECTS) test: erl -noshell -pa ebin -eval 'eunit:test(ebin,[verbose])' -s init stop
  • 5. c` a c cb c %% c= : src/global.hrl -include_lib(eunit/include/eunit.hrl).
  • 6. ` c %% c= : src/empty.erl -module(empty). -include(global.hrl). %% `a ^] a_test() - ok.
  • 7. c `a $ make erlc -o ebin/ src/empty.erl erl -noshell -pa ebin -eval 'eunit:test(ebin,[verbose])' -s init stop ====================== EUnit ====================== directory ebin empty:a_test (module 'empty')...ok [done in 0.007 s] =================================================== Test successful. $
  • 8. test _ `b a ^^ 1 empty:module_info(exports). [{a_test,0},{test,0},{module_info,0}, {module_info,1}] 2 empty:test(). Test passed. ok 3 eunit:test(empty). Test passed. ok 4 empty:a_test(). ok 5 eunit:test({empty,a_test}). Test passed. ok 6
  • 9. `a ERLC_FLAGS=-DNOTEST makefile ^ = `a c ^ Z # A simple Makefile ERLC_FLAGS=-DNOTEST ... `a a ca ^=” make release” ^ Z] release: clean $(MAKE) ERLC_FLAGS=$(ERLC_FLAGS) -DNOTEST
  • 10. `a a c $ make erlc -DNOTEST -o ebin/ src/empty.erl erl -noshell -pa ebin -eval 'eunit:test(ebin,[verbose])' -s init stop ====================== EUnit ====================== directory ebin module 'empty' [done in 0.004 s] There were no tests to run. $
  • 11. `a Z Z [ 1 empty:module_info(exports). [{module_info,0},{module_info,1}] 2 eunit:test(empty). There were no tests to run. ok 3
  • 12. _ca `a c cb c NOTEST c ^ = _ca `a %% : src/global.hrl -define(NOTEST, true). -include_lib(eunit/include/eunit.hrl). = TEST makefile ^ = NOTEST Z Z^ `a ^ makefile a ^ Z^ [=PZ ] Z[
  • 13. `a aV `a a [ eunit.hrl cc ` `Z EUnit ` Z ^ c ^[ `a EUnit = [ aZ ^ EUnit _ `b a 2 ] EUnit Z Z a c B = Z c Z Z ^
  • 14. `a Z %% : src/fib.erl -module(fib). -export([f/1]). -include(global.hrl). f(0) - 1; f(1) - 1; f(N) when N 1 - f(N-1) * f(N-2). f_test() - 1 = f(0), 1 = f(1), 2 = f(2).
  • 15. Badmatch Z = ====================== EUnit ====================== directory ebin fib: f_test (module 'fib')...*failed* ::error:{badmatch,1} in function fib:f_test/0 =================================================== Failed: 1. Skipped: 0. Passed: 0.
  • 16. `a Z ^ %% : src/fib.erl -module(fib). -export([f/1]). -include(global.hrl). f(0) - 1; f(1) - 1; f(N) when N 1 - f(N-1) * f(N-2). f0_test() - 1 = f(0). f1_test() - 1 = f(1). f2_test() - 2 = f(2).
  • 17. Z Z ] ====================== EUnit ====================== directory ebin module 'fib' fib: f0_test...ok fib: f1_test...ok fib: f2_test...*failed* ::error:{badmatch,1} in function fib:f2_test/0 [done in 0.024 s] =================================================== Failed: 1. Skipped: 0. Passed: 0.
  • 18. assert =H Z %% : src/fib.erl -module(fib). -export([f/1]). -include(global.hrl). f(0) - 1; f(1) - 1; f(N) when N 1 - f(N-1) * f(N-2). f0_test() - ?assertEqual(1, f(0)). f1_test() - ?assertEqual(1, f(1)). f2_test() - ?assertEqual(2, f(2)).
  • 19. ^ ^ ] ====================== EUnit ====================== directory ebin module 'fib' fib: f0_test...ok fib: f1_test...ok fib: f2_test...*failed* ::error:{assertEqual_failed,[{module,fib}, {line,14}, {expression,f ( 2 )}, {expected,2}, {value,1}]} in function fib:'-f2_test/0-fun-0-'/1
  • 20. ! assert %% File: src/fib.erl -module(fib). -export([f/1]). -include(global.hrl). f(0) - 1; f(1) - 1; f(N) when N 1 - f(N-1) * f(N-2). f_test() - ?assertEqual(1, f(0)), ?assertEqual(1, f(1)), ?assertEqual(2, f(2)), ?assertEqual(3, f(3)).
  • 21. *% ] ====================== EUnit ====================== directory ebin fib: f_test (module 'fib')...*failed* ::error:{assertEqual_failed,[{module,fib}, {line,13}, {expression,f ( 2 )}, {expected,2}, {value,1}]} in function fib:'-f_test/0-fun-2-'/1 in call from fib:f_test/0
  • 22. ` ac ^ %% : src/fib.erl -module(fib). -export([f/1]). -include(global.hrl). f(0) - 1; f(1) - 1; f(N) when N 1 - f(N-1) * f(N-2). f_test_() - [?_assertEqual(1, f(0)), ?_assertEqual(1, f(1)), ?_assertEqual(2, f(2)), ?_assertEqual(3, f(3))].
  • 23. ^[ `a` a ] fib:11: f_test_...ok fib:12: f_test_...ok fib:13: f_test_...*failed* ::error:{assertEqual_failed,[{module,fib}, {line,13}, {expression,f ( 2 )}, {expected,2}, {value,1}]} in function fib:'-f_test_/0-fun-4-'/1 fib:14: f_test_...*failed* ::error:{assertEqual_failed,[{module,fib}, {line,14}, {expression,f ( 3 )}, {expected,3}, {value,1}]} in function fib:'-f_test_/0-fun-6-'/1
  • 24. _c `a ` ^ %% : src/fib.erl -module(fib). -export([f/1]). -include(global.hrl). f(0) - 1; f(1) - 1; f(N) when N 1 - f(N-1) + f(N-2). f_test_() - [?_assertEqual(1, f(0)), ?_assertEqual(1, f(1)), ?_assertEqual(2, f(2)), ?_assertError(function_clause, f(-1)), ?_assert(f(31) =:= 2178309)].
  • 25. ]Z Z] [= S ====================== EUnit ====================== directory ebin module 'fib' fib:11: f_test_...ok fib:12: f_test_...ok fib:13: f_test_...ok fib:14: f_test_...ok fib:15: f_test_...[0.394 s] ok [done in 0.432 s] =================================================== All 5 tests passed.
  • 26. `a ` c ^ %% : src/fib_tests.erl -module(fib_tests). -include(global.hrl). f_test_() - [?_assertEqual(1, fib:f(0)), ?_assertEqual(1, fib:f(1)), ?_assertEqual(2, fib:f(2)), ?_assertError(function_clause, fib:f(-1)), ?_assert(fib:f(31) =:= 2178309)].
  • 27. ^] 1 eunit:test(fib, [verbose]). ====================== EUnit ====================== module 'fib' module 'fib_tests' fib_tests:6: f_test_...ok fib_tests:7: f_test_...ok fib_tests:8: f_test_...ok fib_tests:9: f_test_...ok fib_tests:11: f_test_...[0.405 s] ok [done in 0.442 s] [done in 0.442 s] =================================================== All 5 tests passed.
  • 28. c c` %% : src/fib.erl -module(fib). -export([f/1, g/1]). f(0) - 1; f(1) - 1; f(N) when N 1 - f(N-1) + f(N-2). g(N) when N = 0 - g(N, 0, 1). g(0, _F1, F2) - F2; g(N, F1, F2) - g(N - 1, F2, F1 + F2).
  • 29. U ^ `aZ %% : src/fib_tests.erl -module(fib_tests). -include(global.hrl). f_test_() - [...]. g_test_() - [?_assertError(function_clause, fib:g(-1)), ?_assertEqual(fib:f(0), fib:g(0)), ?_assertEqual(fib:f(1), fib:g(1)), ?_assertEqual(fib:f(2), fib:g(2)), ?_assertEqual(fib:f(17), fib:g(17)), ?_assertEqual(fib:f(31), fib:g(31))].
  • 30. YZ `a ] ====================== EUnit ====================== module 'fib' module 'fib_tests' fib_tests:6: f_test_...ok fib_tests:7: f_test_...ok fib_tests:8: f_test_...ok fib_tests:9: f_test_...ok fib_tests:11: f_test_...[0.397 s] ok fib_tests:14: g_test_...ok fib_tests:16: g_test_...ok fib_tests:17: g_test_...ok fib_tests:18: g_test_...ok fib_tests:19: g_test_...ok fib_tests:20: g_test_...[0.425 s] ok =================================================== All 11 tests passed.
  • 31. `a Z] Z %% : src/fib_tests.erl -module(fib_tests). -include(global.hrl). f_test_() - [...]. g_test_() - [?_assertEqual(fib:f(N), fib:g(N)) || N - lists:seq(0,33)]. g_error_test() - ?assertError(function_clause, fib:g(-1)).
  • 32. ZZZ ] Z fib_tests:17: g_test_...ok fib_tests:17: g_test_...ok ... fib_tests:17: g_test_...[0.001 s] ok fib_tests:17: g_test_...[0.002 s] ok fib_tests:17: g_test_...[0.003 s] ok fib_tests:17: g_test_...[0.005 s] ok fib_tests:17: g_test_...[0.008 s] ok fib_tests:17: g_test_...[0.013 s] ok fib_tests:17: g_test_...[0.021 s] ok ... fib_tests:17: g_test_...[0.566 s] ok fib_tests:17: g_test_...[0.939 s] ok [done in 3.148 s] =================================================== All 40 tests passed.
  • 33. `a Z ZZZ^ ^ Z] ^ ^][ *= ZZ^ ` _ ] a .( `c c`a= ]c`a=a ]c`a c [ `a ` Z Z [ ^ [[ = 2 ^
  • 34. c ?E ] %% : src/fib_tests.erl -module(fib_tests). -include(global.hrl). ... g_test_() - {inparallel, [?_assertEqual(fib:f(N), fib:g(N)) || N - lists:seq(0,33)] }. ...
  • 35. =] ] [ fib_tests:17: g_test_...ok fib_tests:17: g_test_...ok ... fib_tests:17: g_test_...[0.001 s] ok fib_tests:17: g_test_...ok fib_tests:17: g_test_...[0.003 s] ok fib_tests:17: g_test_...[0.011 s] ok fib_tests:17: g_test_...[0.015 s] ok fib_tests:17: g_test_...[0.023 s] ok fib_tests:17: g_test_...[0.036 s] ok ... fib_tests:17: g_test_...[1.378 s] ok fib_tests:17: g_test_...[1.085 s] ok [done in 1.853 s] =================================================== All 40 tests passed.
  • 36. - c`` %% : src/adder.erl -module(adder). -export([start/0, stop/1, add/2]). start() - spawn(fun server/0). stop(Pid) - Pid ! stop. add(D, Pid) - Pid ! {add, D, self()}, receive {adder, N} - N end. server() - server(0). server(N) - receive {add, D, From} - From ! {adder, N + D}, server(N + D); stop - ok end.
  • 37. n ` | %% : src/adder_tests.erl -module(adder_tests). -include(global.hrl). named_test_() - {setup, fun()- P=adder:start(), register(srv, P), P end, fun adder:stop/1, [?_assertEqual(0, adder:add(0, srv)), ?_assertEqual(1, adder:add(1, srv)), ?_assertEqual(11, adder:add(10, srv)), ?_assertEqual(6, adder:add(-5, srv)), ?_assertEqual(-5, adder:add(-11, srv)), ?_assertEqual(0, adder:add(-adder:add(0, srv), srv))] }.
  • 38. `a ` ` ... anonymous_test_() - {setup, fun adder:start/0, fun adder:stop/1, fun (Srv) - {inorder, %% [?_assertEqual(0, adder:add(0, Srv)), W U W ?_assertEqual(1, adder:add(1, Srv)), ?_assertEqual(11, adder:add(10, Srv)), ?_assertEqual(6, adder:add(-5, Srv)), ?_assertEqual(-5, adder:add(-11, Srv)), ?_assertEqual(0, adder:add(-adder:add(0, Srv), Srv))] } end}.
  • 39. Z Z assert - `a anonymous_test_() - {setup, fun adder:start/0, fun adder:stop/1, fun (Srv) - [?_test( begin ?assertEqual(0, adder:add(0, Srv)), ?assertEqual(1, adder:add(1, Srv)), ?assertEqual(11, adder:add(10, Srv)), ?assertEqual(6, adder:add(-5, Srv)), ?assertEqual(-5, adder:add(-11, Srv)), ?assertEqual(0, adder:add(-adder:add(0, Srv), Srv)) end)] end}.
  • 40. `a b 8 anonymous_test_() - {setup, fun adder:start/0, fun adder:stop/1, fun (Srv) - [?_test( begin assert_add( 0, 0, Srv), ... assert_add(-11, -5, Srv), assert_add(-adder:add(0, Srv), 0, Srv) end )] end}. assert_add(D, N, Srv) - ?assertEqual(N, adder:add(D, Srv)).
  • 41. `a F anonymous_test_() - {setup, fun adder:start/0, fun adder:stop/1, fun (Srv) - {with, Srv, [fun first_subtest/1, ...] } end}. first_subtest(Srv) - assert_add( 0, 0, Srv), ... assert_add(-11, -5, Srv), assert_add(-adder:add(0, Srv), 0, Srv). assert_add(D, N, Srv) - ?assertEqual(N, adder:add(D, Srv)).
  • 42. 'with' ' [ ` a anonymous_test_() - {setup, fun adder:start/0, fun adder:stop/1, {with, [fun first_subtest/1, ...] } }. first_subtest(Srv) - assert_add( 0, 0, Srv), ... assert_add(-11, -5, Srv), assert_add(-adder:add(0, Srv), 0, Srv). assert_add(D, N, Srv) - ?assertEqual(N, adder:add(D, Srv)).
  • 43. `a a Z y [ `a a a Y a ! [ ' ^ [ `a a c c [ (UODQJ Z ^ ^ ^^ S F S a -ifdef(TEST) c (8QLW a c S ^ [Z - ]
  • 44. 2.1 EUNIT ` ( “[verbose]”) A cb a ` 9Z a [ cb a _ a[ ` c Maven (“surefire”) b a `a` a ac ` ZZ[^ ^` ac Z ^ [ ^[ ' 8 [
  • 45. ] Z