add tests for issue 3048

This commit is contained in:
Skgland
2025-08-16 15:29:25 +02:00
committed by Bennet Bleßmann
parent 93cc4d4898
commit e38ee14580
9 changed files with 160 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
:- use_module(library(assoc)).
:- use_module(library(lists)).
:- use_module(library(iso_ext)).
put([_], _).
put([Old, New | Tail], Idx) :-
put_assoc(Idx, Old, 1, New),
IdxP is Idx +1,
put([New |Tail], IdxP).
run(Max, Bad) :-
empty_assoc(A),
length(As, Max),
put([A|As], 1),
findall(Idx, (nth0(Idx, [A|As], Assoc), \+ is_assoc(Assoc)), Bad).
?- N = 20, run(N, Bad).
N = 20, Bad = [3,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20], unexpected
; false.
N = 20, Bad = []
; false.
test :- run(20, []).