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); } }