Closed pmoura closed 21 hours ago
Pushed additional tests for the predicate_property/2
predicate:
$ logtalk_tester -p trealla
% Batch testing started @ 2024-09-30 10:50:27
% Logtalk version: 3.84.0-b01
% Trealla Prolog version: 2.56.22
%
% Documents/Logtalk/logtalk3/tests/prolog/predicates/predicate_property_2
% 29 tests: 0 skipped, 27 passed, 2 failed (0 flaky)
% completed tests from object tests in 2 seconds
% clause coverage n/a
%
% Compilation errors/warnings and failed unit tests
% (compilation errors/warnings might be expected depending on the test)
! commons_predicate_property_2_09: failure (in 0.000006000/0.000000000 cpu/wall seconds)
! test goal succeeded but should have failed
! in file Documents/Logtalk/logtalk3/tests/prolog/predicates/predicate_property_2/tests.lgt between lines 77-78
!
! commons_predicate_property_2_12: failure (in 0.000004000/0.000000000 cpu/wall seconds)
! test goal succeeded but should have failed
! in file Documents/Logtalk/logtalk3/tests/prolog/predicates/predicate_property_2/tests.lgt between lines 86-87
!
%
% Failed tests
Documents/Logtalk/logtalk3/tests/prolog/predicates/predicate_property_2/tests.lgt - commons_predicate_property_2_09 @ tests
Documents/Logtalk/logtalk3/tests/prolog/predicates/predicate_property_2/tests.lgt - commons_predicate_property_2_12 @ tests
%
% 1 test sets: 1 completed, 0 skipped, 0 broken, 0 timedout, 0 crashed
% 29 tests: 0 skipped, 27 passed, 2 failed (0 flaky)
%
% Batch testing ended @ 2024-09-30 10:50:30
What properties does Logtalk rely on? I would like to reduce the number as SWI which I initially tried to model has too many, some redundant.
I would think just ones that correspond to actual properties... like dynamic, exported, discontiguous, meta_predicate, multifile & perhaps some state ones template, line_nbr, built_in and iso.
Actually, ignore that question.
A minimal set of properties would be built_in
, static
, dynamic
, foreign
(assuming FLI support), multifile
, meta_predicate
plus the properties that are a consequence of providing a module system (e.g. imported_from
). Btw, most of these properties are specified in the ISO/IEC 13211-2 standard (not that the specification of the predicate_property/2
belongs there).
Thanks for the quick fix.
Noticed that one of the Logtalk
self_vs_super
example tests is failing. This failure exposes a bug in the Trealla Prolog implementation of thepredicate_property/2
built-in predicate:The
foo/1
predicate is defined inuser
. Enumerating all its properties doesn't (correctly) list thebuilt_in
property. But explicitly checking for this property unexpectedly succeeds.