Sha256: 206e0f07bac4c81ea3bd9101bf7b569aef187921cfe19ea4c2bc22f6f3d5ebfe
Contents?: true
Size: 1.36 KB
Versions: 1
Compression:
Stored size: 1.36 KB
Contents
# tc_comment.rb # Copyright (C) RĂ©mi Even 2016 # # This file is part of Xolti. # # Xolti is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Xolti is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Xolti. If not, see <http://www.gnu.org/licenses/>. require "test/unit" require_relative "../lib/comment" class TestComment < Test::Unit::TestCase def test_simple_comment assert_equal("", Comment.comment("", "# ")) assert_equal("# A\n", Comment.comment("A\n", "# ")) assert_equal("# A\n# B\n", Comment.comment("A\nB\n", "# ")) assert_equal("#\n", Comment.comment("\n", "# ")) end def test_complex_comment assert_equal("/*\n */\n", Comment.comment("", ["/*", " * ", " */"])) assert_equal("/*\n * A\n */\n", Comment.comment("A\n", ["/*", " * ", " */"])) assert_equal("/*\n * A\n * B\n */\n", Comment.comment("A\nB\n", ["/*", " * ", " */"])) assert_equal("/*\n * A\n *\n */\n", Comment.comment("A\n\n", ["/*", " * ", " */"])) end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
xolti-0.2.0 | test/tc_comment.rb |