Using SWI-Prolog (threaded, 64 bits, version 8.5.3) on Windows 10.
I can export the predicate version of an operator from a unit test, using export/1, E.g.
:- begin_tests(my_test).
:- op(900, xfx, ^:>).
:- op(900, xfx, ^*>).
:- export((^:>)/2).
:- export((^*>)/2).
:- end_tests(my_test).
and verify they are exported
?- module_property(plunit_my_test,exports(E)).
E = [(^*>)/2, (^:>)/2].
but I can not figure out how to export the operator itself, E.g
in a normal module it would be like
:- module(examples,
[
example/1,
op(950, xfx, ^:>), % operator being exported
op(950, xfx, ^*>),
(^:>)/2, % predicate version of an operator
(^*>)/2
]).
but export/1 can not be used because it only accepts predicate indicators, which op(950, xfx, ^:>)
is not.