MCPcopy Index your code
hub / github.com/apache/devlake / TestIsNonDateString

Function TestIsNonDateString

backend/core/models/common/iso8601time_test.go:166–229  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

164}
165
166func TestIsNonDateString(t *testing.T) {
167 testCases := []struct {
168 name string
169 input string
170 output bool
171 }{
172 {
173 name: "ZenTao long-term in Chinese",
174 input: "长期",
175 output: true,
176 },
177 {
178 name: "ZenTao long-term in Unicode escape",
179 input: "\\u957f\\u671f",
180 output: true,
181 },
182 {
183 name: "ZenTao long-term in double-escaped Unicode",
184 input: "\\\\u957f\\\\u671f",
185 output: true,
186 },
187 {
188 name: "English long-term",
189 input: "long-term",
190 output: true,
191 },
192 {
193 name: "Chinese permanent",
194 input: "永久",
195 output: true,
196 },
197 {
198 name: "English indefinite",
199 input: "indefinite",
200 output: true,
201 },
202 {
203 name: "English unlimited",
204 input: "unlimited",
205 output: true,
206 },
207 {
208 name: "Valid date string",
209 input: "2023-03-01",
210 output: false,
211 },
212 {
213 name: "Valid datetime string",
214 input: "2023-03-01T12:30:00Z",
215 output: false,
216 },
217 {
218 name: "Random string",
219 input: "random",
220 output: false,
221 },
222 }
223 for _, tc := range testCases {

Callers

nothing calls this directly

Calls 2

isNonDateStringFunction · 0.85
RunMethod · 0.80

Tested by

no test coverage detected