2 * Copyright (c) 2022 PANTHEON.tech, s.r.o. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.yangtools.yang.model.ri.type;
10 import static org.junit.Assert.assertEquals;
12 import com.google.common.collect.Iterables;
13 import com.google.common.collect.Range;
14 import org.junit.Test;
15 import org.opendaylight.yangtools.yang.common.Decimal64;
17 public class BaseDecimalTest {
19 public void testImplicitRanges() {
21 Range.closed(Decimal64.valueOf("-922337203685477580.8"), Decimal64.valueOf("922337203685477580.7")),
22 Iterables.getOnlyElement(BaseDecimalType.constraintsForDigits(1).getAllowedRanges().asRanges()));
24 assertEquals(Range.closed(
25 Decimal64.valueOf("-9.223372036854775808"), Decimal64.valueOf("9.223372036854775807")),
26 Iterables.getOnlyElement(BaseDecimalType.constraintsForDigits(18).getAllowedRanges().asRanges()));