yangys
2025-09-29 4c7296d45efe849dc70a3b2e2240c905481a91c9
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
package org.springblade.mdm.program.service.programannotation;
 
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
 
import java.util.regex.Pattern;
 
public class FanucProcessorTest {
 
    @Test
    public void testMatchOline(){
 
        boolean oMatched = FanucProcessor.PATTERN.matcher("O1234(A-1)").matches();
        Assertions.assertTrue(oMatched);
 
        oMatched = FanucProcessor.PATTERN.matcher("O1234").matches();
        Assertions.assertTrue(oMatched);
 
    }
 
    @Test
    public void testGenProgramNameLine(){
        FanucProcessor p = new FanucProcessor();
        String newLine = p.genProgramNameLine("O1234","(A-1)");
        Assertions.assertEquals("O1234(A-1)", newLine);
 
        newLine = p.genProgramNameLine("O1001(MY zhushi)","(A-1)");
        Assertions.assertEquals("O1001(A-1)", newLine);
    }
}