diff options
Diffstat (limited to 'tools/regression/xsl_reports/xsl/test')
-rw-r--r-- | tools/regression/xsl_reports/xsl/test/test_re_match.xml | 57 | ||||
-rw-r--r-- | tools/regression/xsl_reports/xsl/test/test_re_match.xsl | 60 |
2 files changed, 0 insertions, 117 deletions
diff --git a/tools/regression/xsl_reports/xsl/test/test_re_match.xml b/tools/regression/xsl_reports/xsl/test/test_re_match.xml deleted file mode 100644 index 3841f782d7..0000000000 --- a/tools/regression/xsl_reports/xsl/test/test_re_match.xml +++ /dev/null @@ -1,57 +0,0 @@ -<!-- - -Copyright MetaCommunications, Inc. 2003-2005. - -Distributed under the Boost Software License, Version 1.0. (See -accompanying file LICENSE_1_0.txt or copy at -http://www.boost.org/LICENSE_1_0.txt) - ---> - -<root> - -<test pattern="" text="" result="true"/> -<test pattern="pattern" text="pattern" result="true"/> -<test pattern="" text="pattern" result="false"/> -<test pattern="pattern" text="" result="false"/> - -<test pattern="*" text="" result="true"/> -<test pattern="*" text="pattern" result="true"/> - -<test pattern="*pattern*" text="" result="false"/> -<test pattern="*pattern*" text="__pattern__" result="true"/> -<test pattern="*pattern*" text="pattern" result="true"/> -<test pattern="*pattern*" text="patter" result="false"/> -<test pattern="*pattern*" text="patte__" result="false"/> -<test pattern="*pattern*" text="attern" result="false"/> -<test pattern="*pattern*" text="__ttern" result="false"/> - -<test pattern="*pattern" text="" result="false"/> -<test pattern="*pattern" text="__pattern" result="true"/> -<test pattern="*pattern" text="pattern" result="true"/> -<test pattern="*pattern" text="pattern__" result="false"/> -<test pattern="*pattern" text="patter" result="false"/> -<test pattern="*pattern" text="patte__" result="false"/> -<test pattern="*pattern" text="attern" result="false"/> -<test pattern="*pattern" text="__ttern" result="false"/> - -<test pattern="pattern*" text="" result="false"/> -<test pattern="pattern*" text="pattern__" result="true"/> -<test pattern="pattern*" text="pattern" result="true"/> -<test pattern="pattern*" text="patter" result="false"/> -<test pattern="pattern*" text="__pattern" result="false"/> -<test pattern="pattern*" text="attern" result="false"/> -<test pattern="pattern*" text="patter_" result="false"/> -<test pattern="pattern*" text="patte__" result="false"/> - -<test pattern="patt*ern" text="" result="false"/> -<test pattern="patt*ern" text="patt__ern" result="true"/> -<test pattern="patt*ern" text="pattern" result="true"/> -<test pattern="patter*n" text="patter__n" result="true"/> -<test pattern="p*attern" text="pttern" result="false"/> -<test pattern="p*attern" text="pattern" result="true"/> -<test pattern="patter*n" text="patter" result="false"/> -<test pattern="p*attern" text="attern" result="false"/> -<test pattern="p*attern" text="p_ttern" result="false"/> - -</root> diff --git a/tools/regression/xsl_reports/xsl/test/test_re_match.xsl b/tools/regression/xsl_reports/xsl/test/test_re_match.xsl deleted file mode 100644 index eefd313166..0000000000 --- a/tools/regression/xsl_reports/xsl/test/test_re_match.xsl +++ /dev/null @@ -1,60 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - -Copyright MetaCommunications, Inc. 2003-2004. - -Distributed under the Boost Software License, Version 1.0. (See -accompanying file LICENSE_1_0.txt or copy at -http://www.boost.org/LICENSE_1_0.txt) - ---> - -<xsl:stylesheet - xmlns:xsl="http://www.w3.org/1999/XSL/Transform" - xmlns:exsl="http://exslt.org/common" - xmlns:func="http://exslt.org/functions" - xmlns:str="http://exslt.org/strings" - xmlns:meta="http://www.meta-comm.com" - extension-element-prefixes="func" - exclude-result-prefixes="str meta exsl" - version="1.0"> - - <func:function name="meta:re_match"> - <xsl:param name="pattern"/> - <xsl:param name="text"/> - - <xsl:choose> - <xsl:when test="not( contains( $pattern, '*' ) )"> - <func:result select="$text = $pattern"/> - </xsl:when> - <xsl:when test="$pattern = '*'"> - <func:result select="1 = 1"/> - </xsl:when> - <xsl:when test="substring( $pattern, 1, 1 ) = '*' and substring( $pattern, string-length($pattern), 1 ) = '*' "> - <func:result select="contains( $text, substring( $pattern, 2, string-length($pattern) - 2 ) ) "/> - </xsl:when> - <xsl:when test="substring( $pattern, 1, 1 ) = '*'"> - <xsl:variable name="pattern_tail" select="substring( $pattern, 2, string-length($pattern) - 1 )"/> - <func:result select="substring( $text, string-length($text) - string-length($pattern_tail) + 1, string-length($pattern_tail) ) = $pattern_tail"/> - </xsl:when> - <xsl:when test="substring( $pattern, string-length($pattern), 1 ) = '*' "> - <xsl:variable name="pattern_head" select="substring( $pattern, 1, string-length($pattern) - 1 )"/> - <func:result select="starts-with( $text, $pattern_head )"/> - </xsl:when> - <xsl:when test="contains( $pattern, '*' ) "> - <xsl:variable name="pattern_head" select="substring-before( $pattern, '*' )"/> - <xsl:variable name="pattern_tail" select="substring-after( $pattern, '*' )"/> - <func:result select="starts-with( $text, $pattern_head ) and substring( $text, string-length($text) - string-length($pattern_tail) + 1, string-length($pattern_tail) ) = $pattern_tail"/> - </xsl:when> - </xsl:choose> - </func:function> - - <xsl:template match='test'> - <xsl:variable name="result" select="meta:re_match( @pattern, @text )"/> - <xsl:variable name="expected-result" select="@result = 'true'"/> - <xsl:if test="$result != $expected-result"> - <failed regex="{@pattern}" text="{@text}" result="{$result}" expected-result="{$expected-result}"/> - </xsl:if> - </xsl:template> - -</xsl:stylesheet> |