Skip to content

unit test library #1953

Answered by pmoura
mvolkmann asked this question in Q&A
Aug 6, 2023 · 3 comments · 9 replies
Discussion options

You must be logged in to vote

Given that strings.plt is a plain Prolog file (i.e. it doesn't define a module), its default namespace (when consulted) is already user. To avoid the explicit prefixing of the test predicates, the run_tests/1 would be declared as a meta-predicate. But its argument is not a goal or a closure but a list of closures. That means using:

:- meta_predicate(run_tests(:)).

However, this will not work as you would get a qualified list:

user:[chars_capitalized1,chars_capitalized2,filename_extension1,join1,join2,join3,predicate_namespace_name1,predicate_namespace_name2,repeat1,split1,split2,string_list1,string_list2,string_list3]

which will make the foldl/4 goal fail as it expects a list in the secon…

Replies: 3 comments 9 replies

Comment options

You must be logged in to vote
3 replies
@mvolkmann
Comment options

@pmoura
Comment options

@pmoura
Comment options

Comment options

You must be logged in to vote
2 replies
@pmoura
Comment options

Answer selected by mvolkmann
@mvolkmann
Comment options

Comment options

You must be logged in to vote
4 replies
@pmoura
Comment options

@mvolkmann
Comment options

@pmoura
Comment options

@mvolkmann
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants