@@ -60,11 +60,15 @@ class DateTimeScalarTest extends Specification {
60
60
then :
61
61
thrown(expectedValue)
62
62
where :
63
- input | expectedValue
64
- " 1985-04-12" | CoercingParseValueException
65
- " 2022-11-24T01:00:01.02-00:00" | CoercingParseValueException
66
- mkLocalDT(year : 1980 , hour : 3 ) | CoercingParseValueException
67
- 666 || CoercingParseValueException
63
+ input | expectedValue
64
+ " 1985-04-12" | CoercingParseValueException // No time provided
65
+ " 2022-11-24T01:00:01.02-00:00" | CoercingParseValueException // -00:00 is not a valid offset in specification
66
+ mkLocalDT(year : 1980 , hour : 3 ) | CoercingParseValueException // LocalDateTime has no time zone
67
+ 666 | CoercingParseValueException // A random number
68
+ " 2011-08-30T13:22:53.108" | CoercingParseValueException // No offset provided
69
+ " 2011-08-30T24:22:53.108Z" | CoercingParseValueException // 24 is not allowed as hour of the time
70
+ " 2010-02-30T21:22:53.108Z" | CoercingParseValueException // 30th of February is not a valid date
71
+ " 2010-02-11T21:22:53.108Z+25:11" | CoercingParseValueException // 25 is not a valid hour for offset
68
72
}
69
73
70
74
def " datetime AST literal" () {
@@ -101,11 +105,15 @@ class DateTimeScalarTest extends Specification {
101
105
then :
102
106
thrown(expectedValue)
103
107
where :
104
- input | expectedValue
105
- " 1985-04-12" | CoercingSerializeException
106
- " 2022-11-24T01:00:01.02-00:00" | CoercingSerializeException
107
- mkLocalDT(year : 1980 , hour : 3 ) | CoercingSerializeException
108
- 666 || CoercingSerializeException
108
+ input | expectedValue
109
+ " 1985-04-12" | CoercingSerializeException // No time provided
110
+ " 2022-11-24T01:00:01.02-00:00" | CoercingSerializeException // -00:00 is not a valid offset in specification
111
+ mkLocalDT(year : 1980 , hour : 3 ) | CoercingSerializeException // LocalDateTime has no time zone
112
+ 666 | CoercingSerializeException // A random number
113
+ " 2011-08-30T13:22:53.108" | CoercingSerializeException // No offset provided
114
+ " 2011-08-30T24:22:53.108Z" | CoercingSerializeException // 24 is not allowed as hour of the time
115
+ " 2010-02-30T21:22:53.108Z" | CoercingSerializeException // 30th of February is not a valid date
116
+ " 2010-02-11T21:22:53.108Z+25:11" | CoercingSerializeException // 25 is not a valid hour for offset
109
117
}
110
118
111
119
@Unroll
@@ -116,8 +124,16 @@ class DateTimeScalarTest extends Specification {
116
124
then :
117
125
thrown(expectedValue)
118
126
where :
119
- input | expectedValue
120
- " 2022-11-24T01:00:01.02-00:00" | CoercingParseLiteralException
127
+ input | expectedValue
128
+ " 2022-11-24T01:00:01.02-00:00" | CoercingParseLiteralException // -00:00 is not a valid offset in specification
129
+ " 1985-04-12" | CoercingParseLiteralException // No time provided
130
+ " 2022-11-24T01:00:01.02-00:00" | CoercingParseLiteralException // -00:00 is not a valid offset in specification
131
+ mkLocalDT(year : 1980 , hour : 3 ) | CoercingParseLiteralException // LocalDateTime has no time zone
132
+ 666 | CoercingParseLiteralException // A random number
133
+ " 2011-08-30T13:22:53.108" | CoercingParseLiteralException // No offset provided
134
+ " 2011-08-30T24:22:53.108Z" | CoercingParseLiteralException // 24 is not allowed as hour of the time
135
+ " 2010-02-30T21:22:53.108Z" | CoercingParseLiteralException // 30th of February is not a valid date
136
+ " 2010-02-11T21:22:53.108Z+25:11" | CoercingParseLiteralException // 25 is not a valid hour for offset
121
137
}
122
138
123
139
}
0 commit comments