Skip to content

Commit 4ee2858

Browse files
author
Vadim Averin
committed
Add & canonize some tests
1 parent 66c888d commit 4ee2858

File tree

3 files changed

+97
-1
lines changed

3 files changed

+97
-1
lines changed

ydb/library/yql/udfs/common/ip_base/test/canondata/test.test_Basic_/results.txt

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,26 @@
8787
"String"
8888
]
8989
]
90+
];
91+
[
92+
"single_subnet4";
93+
[
94+
"OptionalType";
95+
[
96+
"DataType";
97+
"String"
98+
]
99+
]
100+
];
101+
[
102+
"single_subnet6";
103+
[
104+
"OptionalType";
105+
[
106+
"DataType";
107+
"String"
108+
]
109+
]
90110
]
91111
]
92112
]
@@ -113,6 +133,12 @@
113133
];
114134
[
115135
"127.0.0.0"
136+
];
137+
[
138+
"127.0.0.1"
139+
];
140+
[
141+
"127.0.0.1"
116142
]
117143
];
118144
[
@@ -136,6 +162,12 @@
136162
];
137163
[
138164
"::"
165+
];
166+
[
167+
"::"
168+
];
169+
[
170+
"::1"
139171
]
140172
];
141173
[
@@ -161,6 +193,12 @@
161193
];
162194
[
163195
"213.180.0.0"
196+
];
197+
[
198+
"213.180.193.3"
199+
];
200+
[
201+
"213.180.193.3"
164202
]
165203
];
166204
[
@@ -186,6 +224,12 @@
186224
];
187225
[
188226
"2a02::"
227+
];
228+
[
229+
"2a02:6b8::"
230+
];
231+
[
232+
"2a02:6b8::3"
189233
]
190234
];
191235
[
@@ -211,6 +255,12 @@
211255
];
212256
[
213257
"2400::"
258+
];
259+
[
260+
"2400:cb00::"
261+
];
262+
[
263+
"2400:cb00:2048:1::681c:1b65"
214264
]
215265
];
216266
[
@@ -236,6 +286,12 @@
236286
];
237287
[
238288
"fe80::"
289+
];
290+
[
291+
"fe80::"
292+
];
293+
[
294+
"fe80::215:b2ff:fea9:67ce"
239295
]
240296
];
241297
[
@@ -261,6 +317,12 @@
261317
];
262318
[
263319
"::"
320+
];
321+
[
322+
"::"
323+
];
324+
[
325+
"::ffff:77.75.155.3"
264326
]
265327
];
266328
[
@@ -272,7 +334,38 @@
272334
#;
273335
#;
274336
#;
337+
#;
338+
#;
275339
#
340+
];
341+
[
342+
[
343+
"\0\0\0\0"
344+
];
345+
[
346+
"0.0.0.0"
347+
];
348+
%true;
349+
%false;
350+
%false;
351+
[
352+
"::ffff:0.0.0.0"
353+
];
354+
[
355+
"0.0.0.0"
356+
];
357+
[
358+
"0.0.0.0"
359+
];
360+
[
361+
"0.0.0.0"
362+
];
363+
[
364+
"0.0.0.0"
365+
];
366+
[
367+
"0.0.0.0"
368+
]
276369
]
277370
]
278371
}

ydb/library/yql/udfs/common/ip_base/test/cases/Basic.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@
66
{"key"="fe80::215:b2ff:fea9:67ce";"subkey"="";"value"=""};
77
{"key"="::ffff:77.75.155.3";"subkey"="";"value"=""};
88
{"key"="sdfsdfsdf";"subkey"="";"value"=""};
9+
{"key"="0.0.0.0";"subkey"="";value=""};

ydb/library/yql/udfs/common/ip_base/test/cases/Basic.sql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ SELECT
88
Ip::ToString(Ip::ConvertToIPv6(internal_representation)) AS all_ipv6,
99
Ip::ToString(Ip::GetSubnet(internal_representation)) AS default_subnet,
1010
Ip::ToString(Ip::GetSubnet(internal_representation, 125)) AS small_subnet,
11-
Ip::ToString(Ip::GetSubnet(internal_representation, 16)) AS large_subnet
11+
Ip::ToString(Ip::GetSubnet(internal_representation, 16)) AS large_subnet,
12+
Ip::ToString(Ip::GetSubnet(internal_representation, 32)) AS single_subnet4,
13+
Ip::ToString(Ip::GetSubnet(internal_representation, 128)) AS single_subnet6
1214
FROM (
1315
SELECT Ip::FromString(key) AS internal_representation FROM Input
1416
);

0 commit comments

Comments
 (0)