Skip to content

Commit b1047ec

Browse files
committed
Add serialization tests.
1 parent 8ec8c6a commit b1047ec

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License
4+
* 2.0; you may not use this file except in compliance with the Elastic License
5+
* 2.0.
6+
*/
7+
8+
package org.elasticsearch.xpack.esql.expression.function.scalar.string;
9+
10+
import org.elasticsearch.xpack.esql.core.expression.Expression;
11+
import org.elasticsearch.xpack.esql.core.tree.Source;
12+
import org.elasticsearch.xpack.esql.expression.AbstractExpressionSerializationTests;
13+
14+
import java.io.IOException;
15+
16+
public class SpaceSerializationTests extends AbstractExpressionSerializationTests<Space> {
17+
@Override
18+
protected Space createTestInstance() {
19+
Source source = randomSource();
20+
Expression number = randomChild();
21+
return new Space(source, number);
22+
}
23+
24+
@Override
25+
protected Space mutateInstance(Space instance) throws IOException {
26+
Source source = instance.source();
27+
Expression number = instance.number();
28+
number = randomValueOtherThan(number, AbstractExpressionSerializationTests::randomChild);
29+
return new Space(source, number);
30+
}
31+
}

0 commit comments

Comments
 (0)