-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_937_reorder_data_in_log_files.rb
72 lines (68 loc) · 1.32 KB
/
test_937_reorder_data_in_log_files.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# frozen_string_literal: true
require_relative '../test_helper'
require_relative '../../lib/medium/937_reorder_data_in_log_files'
require 'minitest/autorun'
class ReorderDataInLogFilesTest < ::Minitest::Test
def test_default_one
assert_equal(
[
'let1 art can',
'let3 art zero',
'let2 own kit dig',
'dig1 8 1 5 1',
'dig2 3 6'
],
reorder_log_files(
[
'dig1 8 1 5 1',
'let1 art can',
'dig2 3 6',
'let2 own kit dig',
'let3 art zero'
]
)
)
end
def test_default_two
assert_equal(
[
'g1 act car',
'a8 act zoo',
'ab1 off key dog',
'a1 9 2 3 1',
'zo4 4 7'
],
reorder_log_files(
[
'a1 9 2 3 1',
'g1 act car',
'zo4 4 7',
'ab1 off key dog',
'a8 act zoo'
]
)
)
end
def test_additional_one
assert_equal(
[
'a2 act car',
'g1 act car',
'a8 act zoo',
'ab1 off key dog',
'a1 9 2 3 1',
'zo4 4 7'
],
reorder_log_files(
[
'a1 9 2 3 1',
'g1 act car',
'zo4 4 7',
'ab1 off key dog',
'a8 act zoo',
'a2 act car'
]
)
)
end
end