[erlang-questions] On Joe's micro-lightweight-unit-testing

Daniel Goertzen daniel.goertzen@REDACTED
Wed Mar 25 12:57:47 CET 2009


Since K is already bound in K=fastfib(25), that expression becomes a
comparison instead of a bind.

What the code really means is...

fib(25)  = fastfib(25),

Dan.

On Wed, Mar 25, 2009 at 6:52 AM, Angel <clist@REDACTED> wrote:

> Hi list
>
> Im very new to erlang, just still astonished about erlang and all, you
> guys, say here
>
> Still im trying every day going deeper and deeper on erlang and functional
> programing.
>
> Got recently very please reading Joe's introcction to TTD and Unit test on
> erlang
>
> shttp://
> armstrongonsoftware.blogspot.com/2009/01/micro-lightweight-unit-testing.html
>
> some where in the article Joe says..
>
> step 4) Add unit tests for fastfib
>
> test/0 looks like this:
>
> test() ->
> 0 = fib(0),
> 1 = fib(1),
> 1 = fib(2),
> 6765 = fib(20),
> 0 = fastfib(0),
> 1 = fastfib(1),
> 1 = fastfib(2),
> 2 = fastfib(3),
> K = fib(25),
> K = fastfib(25),
> ok.
>
> Here I check that fastfib returns the same value as fib with the lines
>  K = fib(25),
> K = fastfib(25).
>
> But K=fib(25) binds K to the value fib(25) so, K= fastbib(25) must be wrong
> as K was previously bound to fib(25) ¿isnt it?
>
> so, What im missing here ?
>
> Thanks
>
> --
> No imprima este correo si no es necesario. El medio ambiente está en
> nuestras manos.
> __________________________________________
>
> Clist UAH a.k.a Angel
> __________________________________________
> ...being the second biggest search engine in the world is good enough for
> us. Peter @ Pirate Bay.
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions
>



-- 
Daniel Goertzen
-----------------
work email: dang@REDACTED
work phone: 1 443 303 8525
work sip: 945050@REDACTED
-----------------
mobile: 1 204 470 8360
-----------------
home email: daniel.goertzen@REDACTED
home phone: 1 204 272 6149
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20090325/e2c24ee1/attachment.htm>


More information about the erlang-questions mailing list