Решение на Трета задача от Никола Ненков
Обратно към всички решения
Към профила на Никола Ненков
Резултати
- 5 точки от тестове
- 1 бонус точка
- 6 точки общо
- 55 успешни тест(а)
- 14 неуспешни тест(а)
Код
Лог от изпълнението
...........F.F.FFFFFF..F..F.................................F..F..F.F
Failures:
1) Graphics Canvas drawing of shapes and rasterization of lines works with simple horizontal lines
Failure/Error: ascii.should eq rendering(expected)
expected: "--------\n---@@@@-\n--------"
got: "--------\n--------\n--------"
(compared using ==)
Diff:
@@ -1,4 +1,4 @@
--------
----@@@@-
+--------
--------
# /tmp/d20131223-4637-488e8s/spec.rb:624:in `check_rendering_of'
# /tmp/d20131223-4637-488e8s/spec.rb:73:in `block (5 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
2) Graphics Canvas drawing of shapes and rasterization of lines works with lines with a small slope
Failure/Error: ascii.should eq rendering(expected)
expected: "----------\n-@@-------\n---@@@@---\n-------@@-\n----------"
got: "------@@--\n---@@-----\n----------\n----------\n----------"
(compared using ==)
Diff:
@@ -1,6 +1,6 @@
+------@@--
+---@@-----
----------
--@@-------
----@@@@---
--------@@-
+----------
----------
# /tmp/d20131223-4637-488e8s/spec.rb:624:in `check_rendering_of'
# /tmp/d20131223-4637-488e8s/spec.rb:100:in `block (5 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
3) Graphics Canvas drawing of shapes and rasterization of lines works with multiple lines
Failure/Error: ascii.should eq rendering(expected)
expected: "-@--------\n-@@-------\n-@-@@@@---\n-@-----@@-\n----------"
got: "-@----@@--\n-@-@@-@---\n----------\n----------\n----------"
(compared using ==)
Diff:
@@ -1,6 +1,6 @@
--@--------
--@@-------
--@-@@@@---
--@-----@@-
+-@----@@--
+-@-@@-@---
+----------
+----------
----------
# /tmp/d20131223-4637-488e8s/spec.rb:624:in `check_rendering_of'
# /tmp/d20131223-4637-488e8s/spec.rb:132:in `block (5 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
4) Graphics Canvas drawing of shapes and rasterization of lines draws lines with two equal ends as points
Failure/Error: canvas.draw make_line(make_point(1, 1), make_point(1, 1))
ZeroDivisionError:
divided by 0
# /tmp/d20131223-4637-488e8s/solution.rb:186:in `/'
# /tmp/d20131223-4637-488e8s/solution.rb:186:in `block in bresenham'
# /tmp/d20131223-4637-488e8s/solution.rb:185:in `upto'
# /tmp/d20131223-4637-488e8s/solution.rb:185:in `each'
# /tmp/d20131223-4637-488e8s/solution.rb:185:in `map'
# /tmp/d20131223-4637-488e8s/solution.rb:185:in `bresenham'
# /tmp/d20131223-4637-488e8s/solution.rb:177:in `line_coordinates'
# /tmp/d20131223-4637-488e8s/solution.rb:168:in `to_a'
# /tmp/d20131223-4637-488e8s/solution.rb:21:in `draw'
# /tmp/d20131223-4637-488e8s/spec.rb:143:in `block (5 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
5) Graphics Canvas drawing of shapes and rasterization of rectangles works with simple rects
Failure/Error: ascii.should eq rendering(expected)
expected: "----------\n-@@@@@@@@-\n-@------@-\n-@@@@@@@@-\n----------"
got: "------@@@@\n-@----@@@@\n----------\n----------\n----------"
(compared using ==)
Diff:
@@ -1,6 +1,6 @@
+------@@@@
+-@----@@@@
----------
--@@@@@@@@-
--@------@-
--@@@@@@@@-
+----------
----------
# /tmp/d20131223-4637-488e8s/spec.rb:624:in `check_rendering_of'
# /tmp/d20131223-4637-488e8s/spec.rb:158:in `block (5 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
6) Graphics Canvas drawing of shapes and rasterization of rectangles works with rects defined with their bottom left and top right points
Failure/Error: ascii.should eq rendering(expected)
expected: "----------\n-@@@@@@@@-\n-@------@-\n-@@@@@@@@-\n----------"
got: "------@@@@\n-@----@@@@\n----------\n----------\n----------"
(compared using ==)
Diff:
@@ -1,6 +1,6 @@
+------@@@@
+-@----@@@@
----------
--@@@@@@@@-
--@------@-
--@@@@@@@@-
+----------
----------
# /tmp/d20131223-4637-488e8s/spec.rb:624:in `check_rendering_of'
# /tmp/d20131223-4637-488e8s/spec.rb:171:in `block (5 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
7) Graphics Canvas drawing of shapes and rasterization of rectangles works with rects with a zero height as a line
Failure/Error: canvas.draw make_rectangle(make_point(1, 1), make_point(8, 1))
ZeroDivisionError:
divided by 0
# /tmp/d20131223-4637-488e8s/solution.rb:186:in `/'
# /tmp/d20131223-4637-488e8s/solution.rb:186:in `block in bresenham'
# /tmp/d20131223-4637-488e8s/solution.rb:185:in `upto'
# /tmp/d20131223-4637-488e8s/solution.rb:185:in `each'
# /tmp/d20131223-4637-488e8s/solution.rb:185:in `map'
# /tmp/d20131223-4637-488e8s/solution.rb:185:in `bresenham'
# /tmp/d20131223-4637-488e8s/solution.rb:177:in `line_coordinates'
# /tmp/d20131223-4637-488e8s/solution.rb:168:in `to_a'
# /tmp/d20131223-4637-488e8s/solution.rb:233:in `to_a'
# /tmp/d20131223-4637-488e8s/solution.rb:21:in `draw'
# /tmp/d20131223-4637-488e8s/spec.rb:182:in `block (5 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
8) Graphics Canvas drawing of shapes and rasterization of rectangles works with rects with a zero width and height as a single point
Failure/Error: canvas.draw make_rectangle(make_point(1, 1), make_point(1, 1))
ZeroDivisionError:
divided by 0
# /tmp/d20131223-4637-488e8s/solution.rb:186:in `/'
# /tmp/d20131223-4637-488e8s/solution.rb:186:in `block in bresenham'
# /tmp/d20131223-4637-488e8s/solution.rb:185:in `upto'
# /tmp/d20131223-4637-488e8s/solution.rb:185:in `each'
# /tmp/d20131223-4637-488e8s/solution.rb:185:in `map'
# /tmp/d20131223-4637-488e8s/solution.rb:185:in `bresenham'
# /tmp/d20131223-4637-488e8s/solution.rb:177:in `line_coordinates'
# /tmp/d20131223-4637-488e8s/solution.rb:168:in `to_a'
# /tmp/d20131223-4637-488e8s/solution.rb:233:in `to_a'
# /tmp/d20131223-4637-488e8s/solution.rb:21:in `draw'
# /tmp/d20131223-4637-488e8s/spec.rb:193:in `block (5 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
9) Graphics Renderers Ascii renders simple canvases
Failure/Error: canvas.render_as(ascii).should eq rendering('
expected: "@---\n----\n---@"
got: "@---\n----\n----"
(compared using ==)
Diff:
@@ -1,4 +1,4 @@
@---
----
----@
+----
# /tmp/d20131223-4637-488e8s/spec.rb:256:in `block (4 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
10) Graphics Renderers Html renders simple canvases
Failure/Error: html_rendering_of(canvas).should eq [
expected: "<i></i><i></i><i></i><i></i><br><i></i><b></b><i></i><i></i><br><i></i><b></b><i></i><i></i>"
got: "<i></i><i></i><i></i><i></i><br><b></b><i></i><i></i><b></b><br><i></i><i></i><i></i><i></i><br>"
(compared using ==)
# /tmp/d20131223-4637-488e8s/spec.rb:291:in `block (4 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
11) Graphics shapes Rectangle comparison for equality is true for rectangles defined with different diagonal corners
Failure/Error: (a == b).should be_true
expected: true value
got: false
# /tmp/d20131223-4637-488e8s/spec.rb:540:in `block (5 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
12) Graphics shapes Rectangle comparison for equality returns the same hash for rectangles defined with different diagonal corners
Failure/Error: a.hash.should eq b.hash
expected: -937315830
got: -951523814
(compared using ==)
# /tmp/d20131223-4637-488e8s/spec.rb:563:in `block (5 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
13) Graphics shapes Rectangle corners top right
Failure/Error: rect.top_right.x.should eq 5
expected: 5
got: 1
(compared using ==)
# /tmp/d20131223-4637-488e8s/spec.rb:583:in `block (5 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
14) Graphics shapes Rectangle corners bottom left
Failure/Error: rect.bottom_left.x.should eq 1
expected: 1
got: 5
(compared using ==)
# /tmp/d20131223-4637-488e8s/spec.rb:595:in `block (5 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
Finished in 0.11051 seconds
69 examples, 14 failures
Failed examples:
rspec /tmp/d20131223-4637-488e8s/spec.rb:69 # Graphics Canvas drawing of shapes and rasterization of lines works with simple horizontal lines
rspec /tmp/d20131223-4637-488e8s/spec.rb:96 # Graphics Canvas drawing of shapes and rasterization of lines works with lines with a small slope
rspec /tmp/d20131223-4637-488e8s/spec.rb:127 # Graphics Canvas drawing of shapes and rasterization of lines works with multiple lines
rspec /tmp/d20131223-4637-488e8s/spec.rb:141 # Graphics Canvas drawing of shapes and rasterization of lines draws lines with two equal ends as points
rspec /tmp/d20131223-4637-488e8s/spec.rb:154 # Graphics Canvas drawing of shapes and rasterization of rectangles works with simple rects
rspec /tmp/d20131223-4637-488e8s/spec.rb:167 # Graphics Canvas drawing of shapes and rasterization of rectangles works with rects defined with their bottom left and top right points
rspec /tmp/d20131223-4637-488e8s/spec.rb:180 # Graphics Canvas drawing of shapes and rasterization of rectangles works with rects with a zero height as a line
rspec /tmp/d20131223-4637-488e8s/spec.rb:191 # Graphics Canvas drawing of shapes and rasterization of rectangles works with rects with a zero width and height as a single point
rspec /tmp/d20131223-4637-488e8s/spec.rb:252 # Graphics Renderers Ascii renders simple canvases
rspec /tmp/d20131223-4637-488e8s/spec.rb:287 # Graphics Renderers Html renders simple canvases
rspec /tmp/d20131223-4637-488e8s/spec.rb:536 # Graphics shapes Rectangle comparison for equality is true for rectangles defined with different diagonal corners
rspec /tmp/d20131223-4637-488e8s/spec.rb:559 # Graphics shapes Rectangle comparison for equality returns the same hash for rectangles defined with different diagonal corners
rspec /tmp/d20131223-4637-488e8s/spec.rb:581 # Graphics shapes Rectangle corners top right
rspec /tmp/d20131223-4637-488e8s/spec.rb:593 # Graphics shapes Rectangle corners bottom left
История (2 версии и 5 коментара)
Никола обнови решението на 16.12.2013 13:43 (преди почти 11 години)
Никола обнови решението на 18.12.2013 14:08 (преди почти 11 години)