<commit_before>%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  
%  This file is part of Logtalk <http://logtalk.org/>
%  
%  Logtalk is free software. You can redistribute it and/or modify it under
%  the terms of the FSF GNU General Public License 3  (plus some additional
%  terms per section 7).        Consult the `LICENSE.txt` file for details.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


:- object(tests,
	extends(lgtunit)).

	:- info([
		version is 1.0,
		author is '<NAME>',
		date is 2015/02/26,
		comment is 'Unit tests for the de facto Prolog standard findall/4 built-in predicate.'
	]).

	succeeds(commons_findall_4_01) :-
		{findall(X, (X=1;X=2), S, [3])},
		S == [1,2,3].

	succeeds(commons_findall_4_02) :-
		{findall(X+_Y, (X=1), S, _)},
		S = [1+_,2+_| _].

	succeeds(commons_findall_4_03) :-
		{findall(_X, fail, L, [0])},
		L == [0].

	succeeds(commons_findall_4_04) :-
		{findall(X, (X=1;X=1), S, [])},
		S == [1,1].

	fails(commons_findall_4_05) :-
		{findall(X, (X=2;X=1), [1,2], _)}.

	succeeds(commons_findall_4_06) :-
		{findall(X, (X=1;X=2), [X,Y,3], T)},
		X == 1, Y == 2, T == [3].

	throws(commons_findall_4_07, error(instantiation_error,_)) :-
		{findall(_X, _Goal, _S, _T)}.
<commit_msg>Fix typo on one of the new `findall/4` unit tests<commit_after>%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  
%  This file is part of Logtalk <http://logtalk.org/>
%  
%  Logtalk is free software. You can redistribute it and/or modify it under
%  the terms of the FSF GNU General Public License 3  (plus some additional
%  terms per section 7).        Consult the `LICENSE.txt` file for details.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


:- object(tests,
	extends(lgtunit)).

	:- info([
		version is 1.0,
		author is '<NAME>',
		date is 2015/02/26,
		comment is 'Unit tests for the de facto Prolog standard findall/4 built-in predicate.'
	]).

	succeeds(commons_findall_4_01) :-
		{findall(X, (X=1;X=2), S, [3])},
		S == [1,2,3].

	succeeds(commons_findall_4_02) :-
		{findall(X+_Y, (X=1), S, _)},
		S = [H| _], callable(H), functor(H, (+), 2), arg(1, H, N), N == 1, arg(2, H, V), var(V).

	succeeds(commons_findall_4_03) :-
		{findall(_X, fail, L, [0])},
		L == [0].

	succeeds(commons_findall_4_04) :-
		{findall(X, (X=1;X=1), S, [])},
		S == [1,1].

	fails(commons_findall_4_05) :-
		{findall(X, (X=2;X=1), [1,2], _)}.

	succeeds(commons_findall_4_06) :-
		{findall(X, (X=1;X=2), [X,Y,3], T)},
		X == 1, Y == 2, T == [3].

	throws(commons_findall_4_07, error(instantiation_error,_)) :-
		{findall(_X, _Goal, _S, _T)}.

{'fraction_non_alphanumeric': 0.2850205453866268, 'fraction_numerical': 0.04519985057900635, 'mean_word_length': 4.2, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2756293', 'n_tokens_mistral': 1191, 'n_tokens_neox': 1059, 'n_words': 251}