# Is it possible to export an operator from a unit test?

**URL:** <https://swi-prolog.discourse.group/t/is-it-possible-to-export-an-operator-from-a-unit-test/4899>\
**Category:** Help!\
**Created:** [January 14, 2022, 4:02pm UTC](https://swi-prolog.discourse.group/t/is-it-possible-to-export-an-operator-from-a-unit-test/4899 "2022-01-14T16:02:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![EricGT](https://avatars.discourse-cdn.com/v4/letter/e/f1d935/32.png) [@EricGT](https://swi-prolog.discourse.group/u/EricGT)\
**Post date:** [January 14, 2022, 4:02pm UTC](https://swi-prolog.discourse.group/t/is-it-possible-to-export-an-operator-from-a-unit-test/4899/1 "2022-01-14T16:02:23Z")

</div>

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](https://www.swi-prolog.org/pldoc/doc_for?object=section(%27packages/plunit.html%27)), using export/1, E.g.

```prolog
:- begin_tests(my_test).

:- op(900, xfx, ^:>).
:- op(900, xfx, ^*>).

:- export((^:>)/2).
:- export((^*>)/2).

:- end_tests(my_test).

```

and verify they are exported

```prolog
?- 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

```prolog
:- 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.
