Vítor De Araújo writes:
> On 10/10/2017 15:21, Arne Babenhauserheide wrote:
>> I’m sorry for answering so late; your suggestion stuck to my mind as a
>> clean and schemish solution for my usecase (thank you!) but it took me
>> quite a while to realize it.
>
> I'm glad you liked it. :)
I do, very
On 10/10/2017 15:21, Arne Babenhauserheide wrote:
> Hi Vitor,
>
> I’m sorry for answering so late; your suggestion stuck to my mind as a
> clean and schemish solution for my usecase (thank you!) but it took me
> quite a while to realize it.
I'm glad you liked it. :)
[snip]
> Now there’s one fir
Hi Vitor,
I’m sorry for answering so late; your suggestion stuck to my mind as a
clean and schemish solution for my usecase (thank you!) but it took me
quite a while to realize it.
Vítor De Araújo writes:
> (define (double x)
> "Returns twice the value of a given number."
> #((examples [(dou
Another possibility beside docstrings would be to add it as a property
to the function. I'm not sure if this is a documented feature, but if
the first form in a function is a literal vector rather than a string
(or in addition to a string, I've just found out!), it will be
interpreted as a sequence
No, I don't think so.
First, s-exp itself can be very literal written just like the srfi-64:
#+begin_src
(test 'foo
(test-equal 1
(one)))
#+end_src
the meanning of this code is very straightforward: do a test whether result
of (one) equals to 1.
and now with my
Chaos Eternal writes:
> Great job!
>
> I have a new idea using s-exps to define tests:
> simple way:
> (define-syntax define-examples
> (syntax-rules () ((_ e ...) (quote (e ...)
>
> then we can simply (read the-file) then (match e ((define-examples e ...))
> (do-test e))
So you’d write so
Hi Mark,
String-literals are a problem I did hit, and I’d be happy to lose that
problem without losing the ease of starting a procedure with tests which
double as automatically verified documentation.
Mark H Weaver writes:
>> (import (examples doctests))
>>
>> (define (one)
>>
2017-07-31 14:51 GMT+02:00 Mark H Weaver :
> Hi Arne,
>
> Arne Babenhauserheide writes:
>
> > I implemented doctests in Guile which allow writing SRFI-64 tests
> > directly in the docstring. Here’s a minimal example:
> >
> >
> > (import (examples doctests))
> >
> > (define (one)
> >
Hi Arne,
Arne Babenhauserheide writes:
> I implemented doctests in Guile which allow writing SRFI-64 tests
> directly in the docstring. Here’s a minimal example:
>
>
> (import (examples doctests))
>
> (define (one)
> "(test 'foo
> (test-equal 1 (one)))"
> 1)
I
Great job!
I have a new idea using s-exps to define tests:
simple way:
(define-syntax define-examples
(syntax-rules () ((_ e ...) (quote (e ...)
then we can simply (read the-file) then (match e ((define-examples e ...))
(do-test e))
On Mon, Jul 31, 2017 at 3:35 AM Arne Babenhauserheide
wr
Hi,
I implemented doctests in Guile which allow writing SRFI-64 tests
directly in the docstring. Here’s a minimal example:
(import (examples doctests))
(define (one)
"(test 'foo
(test-equal 1 (one)))"
1)
(doctests-testmod (current-module))
Writing si
11 matches
Mail list logo