aboutsummaryrefslogtreecommitdiffstats
path: root/document/src/test/java/com/yahoo/document/annotation/DummySpanNodeTestCase.java
blob: 5a04efc2dd1ae5d1b4a072713b04b5775e3854bf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.document.annotation;

import org.junit.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;

/**
 * @author <a href="mailto:einarmr@yahoo-inc.com">Einar M R Rosenvinge</a>
 * @since 5.1.10
 */
public class DummySpanNodeTestCase {

    @Test
    public void basic() {
        DummySpanNode node = DummySpanNode.INSTANCE;
        assertEquals(0, node.getFrom());
        assertEquals(0, node.getTo());
        assertEquals(0, node.getLength());
        assertNull(node.getText("baba"));
        assertTrue(node.isLeafNode());
        assertFalse(node.childIterator().hasNext());
        assertFalse(node.childIterator().hasPrevious());
        assertFalse(node.childIteratorRecursive().hasNext());
        assertFalse(node.childIteratorRecursive().hasPrevious());
    }
}