aboutsummaryrefslogtreecommitdiff
path: root/test/org/traccar/helper/PatternBuilderTest.java
blob: 427161758048a0fc4a325a75131325626f251b8d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
package org.traccar.helper;

import org.junit.Assert;
import org.junit.Test;

public class PatternBuilderTest {
    
    @Test
    public void testPatternBuilder() {
        Assert.assertEquals("\\$GPRMC", new PatternBuilder().text("$GPRMC").toString());
        Assert.assertEquals("(\\d{2}\\.\\p{XDigit}+)", new PatternBuilder().number("(dd.x+)").toString());
        Assert.assertEquals("a(?:bc)?", new PatternBuilder().text("a").text("b").text("c").optional(2).toString());
    }

}