S
Simon Strandgaard
I am working on a regexp engine, where I follow the test first paradigm.
I want my regexp-engine to be compatible with Ruby's, therefore I share
testcases between the 'test_my_regexp.rb' file and the
'test_rubys_regexp.rb' file.
A testcase looks like this:
def test_repeat8
# 'x' REP ___________________________________________ 'x' END
# GRP GRP REP ___________ /GR 'x' REP ___ /GR nil
# GRP ANY /GR nil ANY nil
assert_regex(["x1x2x3x", "1x2x3", "1x2", "2"], "x(((.)*)x.*)*x", "0x1x2x3x4")
end
Sometimes I need to enable verbose debugging for a paticular testcase.
This is what I want to simplify. The way I do it now, are to add
a 'debug=true' flag within the testcase.
def test_repeat8
# 'x' REP ___________________________________________ 'x' END
# GRP GRP REP ___________ /GR 'x' REP ___ /GR nil
# GRP ANY /GR nil ANY nil
assert_regex(["x1x2x3x", "1x2x3", "1x2", "2"], "x(((.)*)x.*)*x", "0x1x2x3x4", true)
end
But I don't like this current approach (files appears to be modified in
CVS). Instead I _dream_ of a 'debug' keyword, which would set a debug-flag
variable for the specified methods. I imagine something like:
class TestScanner < Test::Unit::TestCase
include Repeat
debug test_repeat8, test_repeat9
end
Is it clear what im saying?
Is this possible ?
Any alternatives ?
BTW: has anyone tried my regexp engine ;-) ?
http://raa.ruby-lang.org/list.rhtml?name=regexp
I want my regexp-engine to be compatible with Ruby's, therefore I share
testcases between the 'test_my_regexp.rb' file and the
'test_rubys_regexp.rb' file.
A testcase looks like this:
def test_repeat8
# 'x' REP ___________________________________________ 'x' END
# GRP GRP REP ___________ /GR 'x' REP ___ /GR nil
# GRP ANY /GR nil ANY nil
assert_regex(["x1x2x3x", "1x2x3", "1x2", "2"], "x(((.)*)x.*)*x", "0x1x2x3x4")
end
Sometimes I need to enable verbose debugging for a paticular testcase.
This is what I want to simplify. The way I do it now, are to add
a 'debug=true' flag within the testcase.
def test_repeat8
# 'x' REP ___________________________________________ 'x' END
# GRP GRP REP ___________ /GR 'x' REP ___ /GR nil
# GRP ANY /GR nil ANY nil
assert_regex(["x1x2x3x", "1x2x3", "1x2", "2"], "x(((.)*)x.*)*x", "0x1x2x3x4", true)
end
But I don't like this current approach (files appears to be modified in
CVS). Instead I _dream_ of a 'debug' keyword, which would set a debug-flag
variable for the specified methods. I imagine something like:
class TestScanner < Test::Unit::TestCase
include Repeat
debug test_repeat8, test_repeat9
end
Is it clear what im saying?
Is this possible ?
Any alternatives ?
BTW: has anyone tried my regexp engine ;-) ?
http://raa.ruby-lang.org/list.rhtml?name=regexp