void () { String s1 = "<aaa><bbb class=\"11\"></bbb></aaa><bbb class=\"22\"></bbb>"; String s2 = "<bbb></bbb>"; String s2_2 = "<bbb/>"; String s2_3 = "<'t:[ regex( aaa ) ] />"; String s2_4 = "<'_ 't:[ regex( class ) ]=\"'_\" />"; String s2_5 = "<'_ '_=\"'t:[ regex( 11 ) ]\" />"; assertEquals("Simple xml find", 2, findMatchesCount(s1, s2, XmlFileType.INSTANCE)); assertEquals("Simple xml find with empty tag", 2, findMatchesCount(s1, s2_2, XmlFileType.INSTANCE)); assertEquals("Simple xml find with typed var", 1, findMatchesCount(s1, s2_3, XmlFileType.INSTANCE)); assertEquals("Simple xml find with typed attr", 2, findMatchesCount(s1, s2_4, HtmlFileType.INSTANCE)); assertEquals("Simple xml find with typed attr value", 1, findMatchesCount(s1, s2_5, HtmlFileType.INSTANCE)); assertEquals("Simple xml find with attr without value", 2, findMatchesCount(s1, "<'_ '_+ />", HtmlFileType.INSTANCE)); String s3 = """ <a> content </a> <b> another content </b> <c>another <aaa>zzz</aaa>content </c>"""; String s4 = "<'_tag>'Content+</'_tag>"; assertEquals("Content match", 6, findMatchesCount(s3, s4, HtmlFileType.INSTANCE)); assertEquals("Content match", 6, findMatchesCount(s3, s4, XmlFileType.INSTANCE)); }