-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_36_valid_sudoku.rb
43 lines (40 loc) · 980 Bytes
/
test_36_valid_sudoku.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# frozen_string_literal: true
require_relative '../test_helper'
require_relative '../../lib/medium/36_valid_sudoku'
require 'minitest/autorun'
class ValidSudokuTest < ::Minitest::Test
def test_default_one
assert(
is_valid_sudoku(
[
%w[5 3 . . 7 . . . .],
%w[6 . . 1 9 5 . . .],
%w[. 9 8 . . . . 6 .],
%w[8 . . . 6 . . . 3],
%w[4 . . 8 . 3 . . 1],
%w[7 . . . 2 . . . 6],
%w[. 6 . . . . 2 8 .],
%w[. . . 4 1 9 . . 5],
%w[. . . . 8 . . 7 9]
]
)
)
end
def test_default_two
assert(
!is_valid_sudoku(
[
%w[8 3 . . 7 . . . .],
%w[6 . . 1 9 5 . . .],
%w[. 9 8 . . . . 6 .],
%w[8 . . . 6 . . . 3],
%w[4 . . 8 . 3 . . 1],
%w[7 . . . 2 . . . 6],
%w[. 6 . . . . 2 8 .],
%w[. . . 4 1 9 . . 5],
%w[. . . . 8 . . 7 9]
]
)
)
end
end