diff --git a/_oasis b/_oasis index 4fb421b..3bd040a 100644 --- a/_oasis +++ b/_oasis @@ -35,6 +35,7 @@ Library erm_xmpp Executable test Path: tests + Build$: flag(tests) Install: false Custom: true CompiledObject: best @@ -43,6 +44,7 @@ Executable test Executable lwt_test Path: tests + Build$: flag(tests) Install: false CompiledObject: best MainIs: lwt_test.ml @@ -50,11 +52,20 @@ Executable lwt_test Executable test_ie Path: tests + Build$: flag(tests) Install: false CompiledObject: best MainIs: test_ie.ml BuildDepends: erm_xmpp, erm_treap +Executable punycode_test + Path: tests + Build$: flag(tests) + Install: false + CompiledObject: best + MainIs: punycode_test.ml + BuildDepends: erm_xmpp, erm_treap + # Document api # Title: API reference # InstallDir: $docdir diff --git a/_tags b/_tags index 1b03be4..ccdfdf8 100644 --- a/_tags +++ b/_tags @@ -1,5 +1,5 @@ # OASIS_START -# DO NOT EDIT (digest: a12f4a2de6900edda9520ef8275462f0) +# DO NOT EDIT (digest: aa9c28a0037dedb822caa9b112086b79) # Ignore VCS directories, you can use the same kind of rule outside # OASIS_START/STOP if you want to exclude directories that contains # useless stuff for the build process @@ -37,6 +37,11 @@ : pkg_erm_treap : pkg_erm_xml : pkg_cryptokit +# Executable punycode_test +: use_erm_xmpp +: pkg_erm_treap +: pkg_erm_xml +: pkg_cryptokit : use_erm_xmpp : pkg_erm_treap : pkg_erm_xml diff --git a/setup.ml b/setup.ml index 795b218..4e3b6d7 100644 --- a/setup.ml +++ b/setup.ml @@ -1,7 +1,7 @@ (* setup.ml generated for the first time by OASIS v0.2.0 *) (* OASIS_START *) -(* DO NOT EDIT (digest: c3ea038a837e77901e2126eb9b1b576a) *) +(* DO NOT EDIT (digest: 55989323a96ff6013f8110f11ecf3d55) *) (* Regenerated by OASIS v0.3.1 Visit http://oasis.forge.ocamlcore.org for more information and @@ -5946,7 +5946,11 @@ let setup_t = cs_plugin_data = []; }, { - bs_build = [(OASISExpr.EBool true, true)]; + bs_build = + [ + (OASISExpr.EBool true, false); + (OASISExpr.EFlag "tests", true) + ]; bs_install = [(OASISExpr.EBool true, false)]; bs_path = "tests"; bs_compiled_object = Best; @@ -5973,7 +5977,11 @@ let setup_t = cs_plugin_data = []; }, { - bs_build = [(OASISExpr.EBool true, true)]; + bs_build = + [ + (OASISExpr.EBool true, false); + (OASISExpr.EFlag "tests", true) + ]; bs_install = [(OASISExpr.EBool true, false)]; bs_path = "tests"; bs_compiled_object = Best; @@ -6002,7 +6010,11 @@ let setup_t = cs_plugin_data = []; }, { - bs_build = [(OASISExpr.EBool true, true)]; + bs_build = + [ + (OASISExpr.EBool true, false); + (OASISExpr.EFlag "tests", true) + ]; bs_install = [(OASISExpr.EBool true, false)]; bs_path = "tests"; bs_compiled_object = Best; @@ -6022,6 +6034,37 @@ let setup_t = bs_nativeopt = [(OASISExpr.EBool true, [])]; }, {exec_custom = false; exec_main_is = "test_ie.ml"; }); + Executable + ({ + cs_name = "punycode_test"; + cs_data = PropList.Data.create (); + cs_plugin_data = []; + }, + { + bs_build = + [ + (OASISExpr.EBool true, false); + (OASISExpr.EFlag "tests", true) + ]; + bs_install = [(OASISExpr.EBool true, false)]; + bs_path = "tests"; + bs_compiled_object = Best; + bs_build_depends = + [ + InternalLibrary "erm_xmpp"; + FindlibPackage ("erm_treap", None) + ]; + bs_build_tools = [ExternalTool "ocamlbuild"]; + bs_c_sources = []; + bs_data_files = []; + bs_ccopt = [(OASISExpr.EBool true, [])]; + bs_cclib = [(OASISExpr.EBool true, [])]; + bs_dlllib = [(OASISExpr.EBool true, [])]; + bs_dllpath = [(OASISExpr.EBool true, [])]; + bs_byteopt = [(OASISExpr.EBool true, [])]; + bs_nativeopt = [(OASISExpr.EBool true, [])]; + }, + {exec_custom = false; exec_main_is = "punycode_test.ml"; }); SrcRepo ({ cs_name = "github"; @@ -6046,7 +6089,7 @@ let setup_t = }; oasis_fn = Some "_oasis"; oasis_version = "0.3.1"; - oasis_digest = Some "øDäÄ[×°\004Îl¢^z_[ì"; + oasis_digest = Some "×\012Ì3á\027¾m¨²œ€yYò\t"; oasis_exec = None; oasis_setup_args = []; setup_update = false; @@ -6054,6 +6097,6 @@ let setup_t = let setup () = BaseSetup.setup setup_t;; -# 6058 "setup.ml" +# 6101 "setup.ml" (* OASIS_STOP *) let () = setup ();; diff --git a/tests/punycode_test.ml b/tests/punycode_test.ml new file mode 100644 index 0000000..3a94da6 --- /dev/null +++ b/tests/punycode_test.ml @@ -0,0 +1,12 @@ +open Printf + +let _ = + let str = Sys.argv.(1) in + printf "original: [%s]\n" str; + let decoded = Punycode.decode str in + printf "decoded: [%s]\n" (UTF8.encode decoded); + let encoded = Punycode.encode (Array.of_list decoded) in + printf "encoded: [%s]\n" encoded; + if str <> encoded then + failwith("FAIL") +