require 'test/unit' require 'facet/lisp-format' class FormatTest < Test::Unit::TestCase def test_decimal assert( Lisp.format("~D", 1) == "1" ) end def test_decimal_params assert( Lisp.format("~5,'-D~6D", 1, 2) == "----1 2" ) end def test_decimal_modifiers assert( Lisp.format("~5,'-,'.:@D~@D", 1013, 2) == "+1.013+2" ) assert( Lisp.format("~7,,,2:@D~@D", 1013, 2) == " +10,13+2" ) end # Tests for ~v, ~V, ~# end