www.delorie.com/gnu/docs/greg/greg_21.html   search  
 
Buy GNU books!


Greg testing framework

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.0.4 greg-expect-pass

The greg-expect-pass macro is a shorthand method of writing the most usual sort of testcase - where a fragment of Guile code is run and is expected to return a true result. It passes an assertion and a fragment of Guile code that performs a test to the greg-testcase procedure -
 
; A simple test that basic arithmetic works

(greg-expect-pass "one plus one is two" (eq? (+ 1 1) 2))

is equivalent to -

(greg-testcase "one plus one is two" #t
  (lambda ()
    (eq? (+ 1 1) 2)
  )
)


  webmaster     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003