Changeset 1966 for libcaca/trunk/ruby/t
- Timestamp:
- Nov 15, 2007, 11:22:55 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/ruby/t/tc_canvas.rb
r1965 r1966 8 8 def test_create 9 9 c = Cucul::Canvas.new(3, 3) 10 assert (c, 'Canvas creation failed')10 assert_not_nil(c, 'Canvas creation failed') 11 11 assert(c.width == 3 && c.height == 3, 'Wrong size for new canvas') 12 12 end 13 13 def test_width 14 @c.width=42 15 assert_equal(c.width, 42, 'Failed to set width') 14 @c.width = 42 15 assert_equal(42, @c.width, 'Failed to set width with =') 16 @c.set_width(24) 17 assert_equal(24, @c.width, 'Failed to set width') 16 18 end 17 19 def test_height 18 @c.height=42 19 assert_equal(c.height, 42, 'Failed to set width') 20 @c.height = 42 21 assert_equal(42, @c.height, 'Failed to set height with =') 22 @c.set_height(24) 23 assert_equal(24, @c.height, 'Failed to set height') 20 24 end 21 25 def test_size 22 @c.set_size(100,100)26 @c.set_size(100,100) 23 27 assert(@c.width == 100 && @c.height == 100, 'Failed to set size') 24 28 end 25 29 def test_import 26 30 @c.import_memory("foo", "") 27 assert_equal(@c.export_memory("irc"), "foo\r\n", "Import/Export failed") 31 assert_equal("foo\r\n", @c.export_memory("irc"), "Import/Export failed") 32 end 33 def test_cursor 34 @c.gotoxy(1,1) 35 assert_equal(1, @c.cursor_x) 36 assert_equal(1, @c.cursor_y) 37 end 38 def test_clear 39 @c.put_char(1, 1, 64) 40 @c.clear 41 assert_equal("", @c.export_memory("irc").strip, "Failed to clear canvas") 42 end 43 def test_char 44 @c.put_char(1, 1, 42) 45 assert_equal(42, @c.get_char(1,1)) 28 46 end 29 47 end
Note: See TracChangeset
for help on using the changeset viewer.