Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(538)

Unified Diff: third_party/libxslt/python/tests/exslt.py

Issue 1193533007: Upgrade to libxml 2.9.2 and libxslt 1.1.28 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove suppressions, have landed in blink now Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/libxslt/python/tests/exslt.py
diff --git a/third_party/libxslt/python/tests/exslt.py b/third_party/libxslt/python/tests/exslt.py
new file mode 100755
index 0000000000000000000000000000000000000000..c64b2e43319d8e0307e8ec4447ec09047164c067
--- /dev/null
+++ b/third_party/libxslt/python/tests/exslt.py
@@ -0,0 +1,56 @@
+#!/usr/bin/python -u
+import sys
+import libxml2
+# Memory debug specific
+libxml2.debugMemory(1)
+import libxslt
+
+
+styledoc = libxml2.parseDoc(
+"""<?xml version="1.0"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:str="http://exslt.org/strings"
+ exclude-result-prefixes="str">
+
+<xsl:template match="/">
+<out>;
+ str:tokenize('2001-06-03T11:40:23', '-T:')
+ <xsl:copy-of select="str:tokenize('2001-06-03T11:40:23', '-T:')"/>;
+
+ str:tokenize('date math str')
+ <xsl:copy-of select="str:tokenize('date math str')"/>;
+</out>
+</xsl:template>
+
+</xsl:stylesheet>
+""")
+style = libxslt.parseStylesheetDoc(styledoc)
+doc = libxml2.parseDoc("<doc/>")
+result = style.applyStylesheet(doc, None)
+stringval = style.saveResultToString(result)
+style.freeStylesheet()
+doc.freeDoc()
+result.freeDoc()
+
+expect="""<?xml version="1.0"?>
+<out>;
+ str:tokenize('2001-06-03T11:40:23', '-T:')
+ <token>2001</token><token>06</token><token>03</token><token>11</token><token>40</token><token>23</token>;
+
+ str:tokenize('date math str')
+ <token>date</token><token>math</token><token>str</token>;
+</out>
+"""
+
+if stringval != expect:
+ print "Exslt processing failed"
+ sys.exit(255)
+
+# Memory debug specific
+libxslt.cleanup()
+if libxml2.debugMemory(1) == 0:
+ print "OK"
+else:
+ print "Memory leak %d bytes" % (libxml2.debugMemory(1))
+ libxml2.dumpMemory()

Powered by Google App Engine
This is Rietveld 408576698