You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2022/03/01 03:23:43 UTC

[GitHub] [accumulo] ctubbsii commented on a change in pull request #2535: Serializer for BigDecimal #2226

ctubbsii commented on a change in pull request #2535:
URL: https://github.com/apache/accumulo/pull/2535#discussion_r816420261



##########
File path: core/src/test/java/org/apache/accumulo/core/client/lexicoder/BigDecimalLexicoderTest.java
##########
@@ -0,0 +1,58 @@
+/*
+ * 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.accumulo.core.client.lexicoder;
+
+import java.math.BigDecimal;
+import java.util.Arrays;
+
+import org.apache.accumulo.core.clientImpl.lexicoder.AbstractLexicoderTest;
+import org.junit.jupiter.api.Test;
+
+public class BigDecimalLexicoderTest extends AbstractLexicoderTest {
+
+  @Test
+  public void testSortOrder() {
+
+    assertSortOrder(new BigDecimalLexicoder(), BigDecimal::compareTo,
+        Arrays.asList(new BigDecimal("2.0"), new BigDecimal("2.00"), new BigDecimal("2.000"),
+            new BigDecimal("-3.000"), new BigDecimal("-2.00"), new BigDecimal("0.0000"),
+            new BigDecimal("0.1"), new BigDecimal("0.10"), new BigDecimal("-65537.000"),
+            new BigDecimal("-65537.00"), new BigDecimal("-65537.0")));
+

Review comment:
       I was under the impression that the values here represented the expected sort order. If the test itself is sorting first, I'm not sure it's giving us the test coverage we want. I'd have to spend more time looking.




-- 
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: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org