RAA - elispunit/0.2

elispunit / 0.2

Short description: EmacsLisp Unit Test
Category: Library/Development
Status: usable
Created: 2005-04-09 05:37:12 GMT
Last update: 2005-06-10 01:36:58 GMT
Owner: rubikitch (Projects of this owner)
Homepage: http://www.rubyist.net/~rubikitch/computer/elispunit/
Download: http://www.rubyist.net/~rubikitch/archive/elispunit-0.2.tar.gz
License: GPL
Dependency:
None
Description:

EmacsLisp unit testing library using Test::Unit(RubyUnit) and gnuserv.

Example:
require 'test/unit'
require 'elispunit'

class ElispTestCase < Test::Unit::TestCase
include ElispUnit

# elisp %((load "some-lispfile.el"))

def_test("plus") do
elisp %((setq a 1))
eq? '2', %((+ a 1))
t? %((eq 2 (+ a 1)))
nil? %((eq 10 (+ a 1)))

end


def_test("multi") do
msg = elisp %(1 2)
assert_equal("2", msg)
end

def_test("buffer-string") do
buf = "*ielm*".dump
bs = elisp %(1 (with-current-buffer #{buf} (buffer-string)))
bs2 = elisp %((with-current-buffer #{buf} (buffer-string)))
assert_equal(bs, bs2)
end


def_test("save") do
assert_equal("2", save("2"))
assert_equal("3", save("(+ 2 1)"))
end

def_test("error") do
assert_raise(ElispUnit::LispError){ elisp("undefined-variable----x")}
assert_raise(ElispUnit::LispError){ elisp("(undefined-function----x)")}
#elisp("(undefined-function----x)")
end

def test_buffer_string
begin
buf = "*elispunit tmp*"
content = "aaa"
elisp %Q((with-current-buffer (switch-to-buffer #{buf.dump})
(insert #{content.dump})))
assert_equal(content, buffer_string(buf))
ensure
elisp %((kill-buffer #{buf.dump}))
end
end





end

Versions: [0.2 (2005-06-10)] [0.1 (2005-04-10)]

Edit this project (for project owner)

back to RAA top