guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SRFI-64 implementation for Guile 2.0


From: Sunjoong Lee
Subject: Re: SRFI-64 implementation for Guile 2.0
Date: Sat, 14 Apr 2012 10:39:26 +0900

I fixed some bugs and changed test-error to detect using message string too because of 'misc-error and 'syntax-error.
For example, "^missing or extra _expression_" and "^string contains #\\\\nul character" are both 'misc-error.

Example1: just check whether a exception occurs?

  scheme@(guile-user)> (use-modules (srfi srfi-64))
  scheme@(guile-user)> (test-begin "wrong-type-arg")
%%%% Starting test wrong-type-arg  (Writing full log to "wrong-type-arg.log")
  $1 = ("wrong-type-arg")
  scheme@(guile-user)> (test-error #t (+ "1" 2))
  $2 = pass
  scheme@(guile-user)> (test-end)
  # of expected passes      1
  $3 = (1 0 0 0 0)

Example2: check a specific exception occurs?

  scheme@(guile-user)> (use-modules (srfi srfi-64))
  scheme@(guile-user)> (test-begin "wrong-type-arg")
%%%% Starting test wrong-type-arg  (Writing full log to "wrong-type-arg.log")
  $1 = ("wrong-type-arg")
  scheme@(guile-user)> (test-error 'wrong-type-arg (+ "1" 2))
  $2 = pass
  scheme@(guile-user)> (test-end)
  # of expected passes      1
  $3 = (1 0 0 0 0)

Example3: check a exception throw a certain message?

  scheme@(guile-user)> (use-modules (srfi srfi-64))
  scheme@(guile-user)> (test-begin "wrong-type-arg")
%%%% Starting test wrong-type-arg  (Writing full log to "wrong-type-arg.log")
  $1 = ("wrong-type-arg")
scheme@(guile-user)> (test-error "^Wrong type" (+ "1" 2))
  $2 = pass
  scheme@(guile-user)> (test-end)
  # of expected passes      1
  $3 = (1 0 0 0 0)

2012/4/13 Sunjoong Lee <address@hidden>
Hello, world! :)

I'm a newbie of scheme. I'd heard the testing framework SRFI-64 but failed to use it on Guile 2.0.
After attempt to solve this problem, I made a guile module to pass the test suite for SRFI-64 by Donovan Kolbly.

Attachment: srfi-64.scm
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]