fix leak with strings!
[m6w6/ext-psi] / tests / idn / idn004.phpt
diff --git a/tests/idn/idn004.phpt b/tests/idn/idn004.phpt
new file mode 100644 (file)
index 0000000..d70f307
--- /dev/null
@@ -0,0 +1,30 @@
+--TEST--
+libidn
+--INI--
+psi.directory={PWD}
+--SKIPIF--
+<?php
+extension_loaded("psi") or die("skip - need ext/psi");
+?>
+--FILE--
+===TEST===
+<?php 
+
+$result = "buecher.de";
+$rc = idn\utf8_to_ascii("bücher.de", $result, IDNA_USE_STD3_ASCII_RULES);
+printf("%s\n", $result);
+printf("%s\n", idn\strerror($rc));
+
+$rc = idn\utf8_to_ascii("bücher2.de", $result, IDNA_USE_STD3_ASCII_RULES);
+printf("%s\n", $result);
+printf("%s\n", idn\strerror($rc));
+
+?>
+===DONE===
+--EXPECT--
+===TEST===
+xn--bcher-kva.de
+Success
+xn--bcher2-3ya.de
+Success
+===DONE===
\ No newline at end of file