This commit is contained in:
swrup 2025-11-11 02:07:51 +01:00
parent aa2ff7b2f0
commit 2f3113f55d
11742 changed files with 1223940 additions and 0 deletions

View file

@ -0,0 +1,14 @@
(rule
(package ppxlib)
(alias runtest)
(enabled_if
(>= %{ocaml_version} "4.08.0"))
(deps
(:test test.ml)
(package ppxlib))
(action
(chdir
%{project_root}
(progn
(run expect-test %{test})
(diff? %{test} %{test}.corrected)))))

View file

@ -0,0 +1,46 @@
open Ppxlib;;
Expansion_helpers.mangle (Prefix "pre") "foo";;
[%%expect{|
- : string = "pre_foo"
|}]
Expansion_helpers.mangle (Suffix "suf") "foo";;
[%%expect{|
- : string = "foo_suf"
|}]
Expansion_helpers.mangle (PrefixSuffix ("pre", "suf")) "foo";;
[%%expect{|
- : string = "pre_foo_suf"
|}]
Expansion_helpers.mangle (Prefix "pre") "t";;
[%%expect{|
- : string = "pre"
|}]
Expansion_helpers.mangle (Suffix "suf") "t";;
[%%expect{|
- : string = "suf"
|}]
Expansion_helpers.mangle (PrefixSuffix ("pre", "suf")) "t";;
[%%expect{|
- : string = "pre_suf"
|}]
Expansion_helpers.mangle ~fixpoint:"foo" (Prefix "pre") "foo";;
[%%expect{|
- : string = "pre"
|}]
Expansion_helpers.mangle ~fixpoint:"foo" (Suffix "suf") "foo";;
[%%expect{|
- : string = "suf"
|}]
Expansion_helpers.mangle ~fixpoint:"foo" (PrefixSuffix ("pre", "suf")) "foo";;
[%%expect{|
- : string = "pre_suf"
|}]