-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathsql_tests.rb
99 lines (88 loc) · 2.03 KB
/
sql_tests.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# frozen_string_literal: true
require 'openstudio' unless defined?(OpenStudio)
# The config and helpers are inside this file
require_relative 'test_helpers'
# the tests
class SqlTests < Minitest::Test
parallelize_me!
def test_sql_default_fullyear
# Full year, calendar year not specified
options = {
start: nil,
end: nil,
isLeapYear: false,
type: 'Full'
}
result = sql_test(options)
end
def test_sql_specific_fullyear_nonleap
# Full year, calendar year hard assigned to a non-leap year
options = {
start: '2013-01-01',
end: '2013-12-31',
isLeapYear: false,
type: 'Full'
}
result = sql_test(options)
end
def test_sql_specific_fullyear_leap
# Full year, calendar year hard assigned to a leap year
options = {
start: '2012-01-01',
end: '2012-12-31',
isLeapYear: true,
type: 'Full'
}
result = sql_test(options)
end
def test_sql_partial_leap_mid
# Partial with leap day in middle
options = {
start: '2012-02-10',
end: '2012-03-10',
isLeapYear: true,
type: 'Partial'
}
result = sql_test(options)
end
def test_sql_partial_leap_end
# Partial with leap day at end
options = {
start: '2012-02-01',
end: '2012-02-29',
isLeapYear: true,
type: 'Partial'
}
result = sql_test(options)
end
def test_sql_partial_leap_start
# Partial with leap day at start
options = {
start: '2012-02-29',
end: '2012-03-10',
isLeapYear: true,
type: 'Partial'
}
result = sql_test(options)
end
def test_sql_wrap_nonleap
# Wrap-around with no leap days
options = {
start: '2013-02-10',
end: '2014-02-09',
isLeapYear: false,
type: 'Wrap-around'
}
result = sql_test(options)
end
def test_sql_wrap_leap
# Wrap-around with leap day
options = {
start: '2012-02-10',
end: '2013-02-09',
isLeapYear: true,
type: 'Wrap-around'
}
result = sql_test(options)
end
end