Sha256: 3cbc17870366b72c599863f0f9a690f2f65bbe6369a157975def5fd6094d2127

Contents?: true

Size: 872 Bytes

Versions: 7

Compression:

Stored size: 872 Bytes

Contents

require_relative 'helpers'
require 'libtcod'
require 'minitest/autorun'

class TestColor < Minitest::Test
  def setup
    @c1 = TCOD::Color.rgb(255,0,1)
    @c2 = TCOD::Color.rgb(100,4,58)
  end

  def test_create_colors
    c = TCOD::Color.rgb(5,5,5)
    c2 = TCOD::Color.hsv(5,5,5)
  end
  
  def test_compare_colors
    c1 = TCOD::Color.rgb(2, 4, 8)
    c2 = TCOD::Color.rgb(2, 4, 8)
    c3 = TCOD::Color.rgb(8, 16, 32)
    assert_equal c1, c2
    refute_equal c1, c3
  end

  def test_multiply_colors
    c1 = TCOD::Color.rgb(55,100,250)
    c2 = TCOD::Color.rgb(70, 130, 224)
    c3 = c1 * c2
    assert_equal c3, TCOD::Color.rgb(15, 50, 219)
  end

  def test_multiply_colors_float
    c1 = TCOD::Color.rgb(55,100,250)
    c2 = c1*2
    assert_equal c2, TCOD::Color.rgb(110, 200, 255)
  end

  def test_adding_colors
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
libtcod-0.0.9 test/color.rb
libtcod-0.0.8 test/color.rb
libtcod-0.0.7 test/color.rb
libtcod-0.0.6 test/color.rb
libtcod-0.0.5 test/color.rb
libtcod-0.0.4 test/color.rb
libtcod-0.0.3 test/color.rb