Comments (10)
Oops! The tests indeed change the flag! Look at the iso_bagof_3_09
and iso_setof_3_11
tests. Those tests are inside a conditional compilation block that, in the case of GNU Prolog (but not for the other systems where I run the new tests), results in the "else" definition to run. This happens due to GNU Prolog not defining (^)/1
a predicate (which is perfectly fine). I will fix the tests. Sorry for the false alarm and wasting your time like this!
from gprolog.
If I trace the test execution:
| ?- tests::run(lgt_setof_3_37).
Call: (1) tests::run(lgt_setof_3_37) ?
Call: (2) test(lgt_setof_3_37,_9760) ?
Fact: (2) test(lgt_setof_3_37,throws(lgt_setof_3_37,[],[error(existence_error(procedure,foobar/1),_12122),error(existence_error(procedure,user:foobar/1),_12133)],295-296)) ?
Exit: (2) test(lgt_setof_3_37,throws(lgt_setof_3_37,[],[error(existence_error(procedure,foobar/1),_12122),error(existence_error(procedure,user:foobar/1),_12133)],295-296)) ?
Call: (3) test(lgt_setof_3_37,[],[error(existence_error(procedure,foobar/1),_12122),error(existence_error(procedure,user:foobar/1),_12133)]) ?
Rule: (3) test(lgt_setof_3_37,[],[error(existence_error(procedure,foobar/1),_12122),error(existence_error(procedure,user:foobar/1),_12133)]) ?
Call: (4) {setof(_18564,foobar(_18564),_18566)} ?
Compiled goal: setof(A,foobar(A),B)
Call: (4) {setof(_18564,foobar(_18564),_18566)} ?
Fail: (4) {setof(_18564,foobar(_18564),_18566)} ?
Fail: (3) test(lgt_setof_3_37,[],[error(existence_error(procedure,foobar/1),_12122),error(existence_error(procedure,user:foobar/1),_12133)]) ?
! lgt_setof_3_37: failure (in 0.0010000000000001119 seconds)
! test goal failed but should have thrown an error:
! expected error(existence_error(procedure,foobar/1),A)
! in file /Users/pmoura/logtalk/tests/prolog/predicates/setof_3/tests.lgt between lines 295-296
...
The "Compiled goal:" line shows the actual goal being called ({}/1
is a Logtalk compiler bypass control construct, used here to ensure that the test goal is called as-is).
from gprolog.
Is it a new bug (or present in previous version) ?
from gprolog.
No idea. I didn’t try these new tests with 1.5.0.
from gprolog.
If we break during the debugging session:
| ?- tests::run(lgt_setof_3_37).
Call: (1) tests::run(lgt_setof_3_37) ?
Call: (2) test(lgt_setof_3_37,_9760) ?
Fact: (2) test(lgt_setof_3_37,throws(lgt_setof_3_37,[],[error(existence_error(procedure,foobar/1),_12122),error(existence_error(procedure,user:foobar/1),_12133)],295-296)) ?
Exit: (2) test(lgt_setof_3_37,throws(lgt_setof_3_37,[],[error(existence_error(procedure,foobar/1),_12122),error(existence_error(procedure,user:foobar/1),_12133)],295-296)) ?
Call: (3) test(lgt_setof_3_37,[],[error(existence_error(procedure,foobar/1),_12122),error(existence_error(procedure,user:foobar/1),_12133)]) ?
Rule: (3) test(lgt_setof_3_37,[],[error(existence_error(procedure,foobar/1),_12122),error(existence_error(procedure,user:foobar/1),_12133)]) ?
Call: (4) {setof(_18564,foobar(_18564),_18566)} ?
Fail: (4) {setof(_18564,foobar(_18564),_18566)} ? b
{Break Level 1}
{1}
| ?- setof(A,foobar(A),B).
no
{1}
| ?- setof(A,foobar42(A),B).
no
{1}
| ?-
from gprolog.
Somewhere the Prolog flag unknown
is set to fail
while running{tester}
, thus the problem:
$ gplgt.sh
GNU Prolog 1.5.1 (64 bits)
Compiled Mar 22 2023, 18:39:20 with gcc
Copyright (C) 1999-2023 Daniel Diaz
...
Logtalk 3.64.0-b01
Copyright (c) 1998-2023 Paulo Moura
...
% For Logtalk compiler warnings/errors explanations and fix suggestions, use:
% ?- {tutor(loader)}. or ?- logtalk_load(tutor(loader)).
%
| ?- current_prolog_flag(unknown, X).
X = error
yes
| ?- {tester}.
...%
% tests started at 2023-03-22, 23:20:45
%
% running tests from object tests
% file: /home/diaz/lgt3git/tests/prolog/predicates/setof_3/tests.lgt
...
% lgt_setof_3_36: skipped
! lgt_setof_3_37: failure (in 0.0 seconds)
! test goal failed but should have thrown an error:
! expected error(existence_error(procedure,foobar/1),A)
! in file /home/diaz/lgt3git/tests/prolog/predicates/setof_3/tests.lgt between lines 295-296
% wg17_setof_3_38: success (in 0.0 seconds)
%
% 38 tests: 2 skipped, 35 passed, 1 failed (0 flaky)
% completed tests from object tests
| ?- current_prolog_flag(unknown, X).
X = fail
yes
| ?- set_prolog_flag(unknown, error).
yes
| ?- tests::run(lgt_setof_3_37).
% lgt_setof_3_37: success (in 0.0 seconds)
%
% 1 tests: 0 skipped, 1 passed, 0 failed (0 flaky)
% completed tests from object tests
%
% no code coverage information collected
BTW: can I "load" the tests without executing all (as done by {tester}
and only run one test, e.g. tests::run(lgt_setof_3_37)
?
from gprolog.
Odd. Logtalk never changes that flag.
from gprolog.
You can modify the tester.lgt
file and change the tests::run
goal to tests::run(lgt_setof_3_37)
.
from gprolog.
Odd. Logtalk never changes that flag.
Rapidly doing a grep in the git repo:
...
grep -nr 'set_prolog_flag( *unknown' .
tests/prolog/predicates/setof_3/tests.lgt:137: {set_prolog_flag(unknown, fail),
tests/prolog/predicates/bagof_3/tests.lgt:96: {set_prolog_flag(unknown, fail),
from gprolog.
Fixed tests pushed. All bagof/3
and setof/3
tests now pass.
from gprolog.
Related Issues (20)
- Leak with simple arithmetics HOT 4
- Power not defined HOT 1
- Linking error riscv64
- Problem processing repeated calls HOT 3
- New show_information flag regression HOT 1
- Typo in Load_Math_Expression?
- Insure project web site
- GNU Prolog Parser accepts incomplete clause.
- hand written C code lacks some garbage collection.
- real_file_name does not follow symlinks on Windows HOT 1
- numbervars/3 silently refuses to number vars
- ensure_loaded/1 wants suddently predicate indicator HOT 1
- Ubuntu defaults so that GNU compile result is speedy HOT 1
- Incorrect answers when exceeding domains
- phrase/2 too eager execution HOT 1
- Feature request: format_time
- Ma2Asm for linux x64 with gcc is not generating PIC code (v1.5.0+)
- GNU Prolog crashes when reading long string literals
- GNU Prolog segmentation faults when using read_term/3 on a huge file
- formatting floats (adaptive 16 or 17 decimal precision)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gprolog.