RussellSpitzer commented on code in PR #1229:
URL: https://github.com/apache/polaris/pull/1229#discussion_r2017647728


##########
tools/varint/src/test/java/org/apache/polaris/tools/varint/TestVarInt.java:
##########
@@ -0,0 +1,96 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.polaris.tools.varint;
+
+import static org.junit.jupiter.params.provider.Arguments.arguments;
+
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import java.util.stream.Stream;
+import org.assertj.core.api.SoftAssertions;
+import org.assertj.core.api.junit.jupiter.InjectSoftAssertions;
+import org.assertj.core.api.junit.jupiter.SoftAssertionsExtension;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.Arguments;
+import org.junit.jupiter.params.provider.MethodSource;
+
+@ExtendWith(SoftAssertionsExtension.class)
+public class TestVarInt {
+  @InjectSoftAssertions SoftAssertions soft;
+
+  @Test
+  public void negative() {
+    var buf = ByteBuffer.allocate(9);
+    soft.assertThatIllegalArgumentException().isThrownBy(() -> 
VarInt.putVarInt(buf, -1L));
+    soft.assertThatIllegalArgumentException()
+        .isThrownBy(() -> VarInt.putVarInt(buf, Long.MIN_VALUE));
+  }
+
+  @ParameterizedTest
+  @MethodSource
+  public void varInt(long value, byte[] binary) {

Review Comment:
   This feels like we aren't really flexing the code base here.  I would assume 
we would want to be doing a series of ser/de where we serialize and deserialize 
random positive integers and prove that the same value goes in and out. Because 
of the lightness of the operations here we should be able to fuzz hundreds of 
thousands of values in a ms duration test right?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to