Sha256: 2783e9fc1126c95c0b8642e03e49a72aad3f9a3b38eca06aefda95508a34d44b
Contents?: true
Size: 1.59 KB
Versions: 2
Compression:
Stored size: 1.59 KB
Contents
# # Testing OpenWFEru # # John Mettraux at openwfe.org # # Mon Oct 9 22:19:44 JST 2006 # require 'test/unit' require 'ru/dollar' # # testing the 'dollar notation' # class DollarTest < Test::Unit::TestCase #def setup #end #def teardown #end def test_one dict = {} dict['renard'] = 'goupil' dict['cane'] = 'oie' dict['oie blanche'] = 'poule' dotest("le petit renard", dict, "le petit renard") dotest("le petit {renard}", dict, "le petit {renard}") dotest("le petit ${renard}", dict, "le petit goupil") dotest("le petit ${renard} noir", dict, "le petit goupil noir") dotest("la grande ${${cane} blanche}", dict, "la grande poule") dotest("le ${renard} et la ${cane}", dict, "le goupil et la oie") # # excuse my french... dotest("le \\${renard} encore", dict, "le \\${renard} encore") dotest("", dict, "") dotest(""" """, dict, """ """) dotest(""" """, dict, """ """) end def test_two dict = {} dict['x'] = 'y' dotest("${x}", dict, "y") dotest("\\${x}", dict, "\\${x}") end def test_three dict = {} dict['A'] = 'a' dict['B'] = 'b' dict['ab'] = 'ok' dotest("${${A}${B}}", dict, "ok") end def dotest (text, dict, target) result = OpenWFEru::dsub(text, dict) #puts "..>#{text}<" #puts "...->" #puts "..>#{result}<" #puts assert \ result == target, ">#{result}< != >#{target}<" end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
openwferu-0.9.1 | test/dollartest.rb |
openwferu-0.9.0 | test/dollartest.rb |