Clean up TreeNode API
[yangtools.git] / common / yang-common / src / test / java / org / opendaylight / yangtools / yang / common / QNameModuleTest.java
1 /*
2  * Copyright (c) 2024 PANTHEON.tech, s.r.o. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.yangtools.yang.common;
9
10 import static org.junit.jupiter.api.Assertions.assertEquals;
11
12 import java.util.Optional;
13 import org.junit.jupiter.api.Test;
14
15 class QNameModuleTest {
16     @Test
17     void hashCodeValues() {
18         final var mod1 = QNameModule.create(XMLNamespace.of("foo"), Optional.empty());
19         assertEquals(3149755, mod1.hashCode());
20         final var mod2 = QNameModule.create(XMLNamespace.of("foo"), Revision.of("2024-01-26"));
21         assertEquals(-610191810, mod2.hashCode());
22     }
23 }