diff --git a/README.md b/README.md index d423ec7..2ba2982 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,8 @@ A package is a directory with a `scryer-manifest.pl`, the current schema is some name("name_of_the_package"). % Optional. The file that will be imported when this package is used. main_file("main.pl"). +% The license of the package +license(name("Unlicense"), path("./UNLICENSE")) % Optional dependencies([ % A git url to clone @@ -33,7 +35,7 @@ dependencies([ Copy the `bakage.pl` file [from the releases](https://github.com/bakaq/bakage/releases) into your project. It is -both the dependency manager and the package loader. Use `./bakage.pl install"` +both the dependency manager and the package loader. Use `./bakage.pl install` to download the dependencies to a `scryer_libs` directory (it doesn't handle transitive dependencies yet). You can then import packages in your code as follows: diff --git a/example/scryer-manifest.pl b/example/scryer-manifest.pl index 8eaedd0..93b544b 100644 --- a/example/scryer-manifest.pl +++ b/example/scryer-manifest.pl @@ -1,6 +1,8 @@ name("name_of_the_package"). % Optional. The file that will be imported when this package is used. main_file("main.pl"). +%License +license(name("UNLICENSE")). % Optional dependencies([ % A git url to clone diff --git a/justfile b/justfile index 507d75b..df57d97 100644 --- a/justfile +++ b/justfile @@ -17,6 +17,10 @@ build: codegen-scripts cat ./src/shebang.sh > "./build/{{BUILD_NAME}}" cat ./src/bakage.pl >> "./build/{{BUILD_NAME}}" printf "\n" >> "./build/{{BUILD_NAME}}" + cat ./src/qupak.pl >> "./build/{{BUILD_NAME}}" + printf "\n" >> "./build/{{BUILD_NAME}}" + cat ./src/validation.pl >> "./build/{{BUILD_NAME}}" + printf "\n" >> "./build/{{BUILD_NAME}}" cat ./src/cli.pl >> "./build/{{BUILD_NAME}}" printf "\n" >> "./build/{{BUILD_NAME}}" cat ./build/scripts.pl >> "./build/{{BUILD_NAME}}" @@ -26,7 +30,7 @@ build: codegen-scripts codegen-scripts: ensure-build-directory #!/bin/sh set -eu - + touch ./build/scripts.pl for file in scripts/*.sh; do diff --git a/src/bakage.pl b/src/bakage.pl index 278b9a2..e3a823b 100755 --- a/src/bakage.pl +++ b/src/bakage.pl @@ -131,108 +131,6 @@ current_output(Out), phrase_to_stream((portray_clause_(D), "is malformed: ", Error, "\n"), Out). -% A valid dependency -valid_dependencies([]) --> []. - -valid_dependencies([dependency(Name, path(Path))| Ds]) --> { - if_( - (memberd_t(';', Name) - ; memberd_t('|', Name) - ; memberd_t(';', Path) - ; memberd_t('|', Path) - ), - ( - Error = "the name and the path of the dependency should not contain an \";\" or an \"|\" caracter", - M = validate_dependency(dependency(Name, path(Path)))-error(Error), - user_message_malformed_dependency(dependency(Name, path(Path)), Error) - ), - M = validate_dependency(dependency(Name, path(Path)))-success - ) - }, - [M], - valid_dependencies(Ds). - -valid_dependencies([dependency(Name, git(Url))| Ds]) --> { - if_( - (memberd_t(';', Name) - ; memberd_t('|', Name) - ; memberd_t(';', Url) - ; memberd_t('|', Url) - ), - ( - Error = "the name of the dependency and the url should not contain an \";\" or an \"|\" caracter", - M = validate_dependency(dependency(Name, git(Url)))-error(Error), - user_message_malformed_dependency(dependency(Name, git(Url)), Error) - ), - M = validate_dependency(dependency(Name, git(Url)))-success - ) - }, - [M], - valid_dependencies(Ds). - -valid_dependencies([dependency(Name, git(Url, branch(Branch)))| Ds]) --> { - if_( - (memberd_t(';', Name) - ; memberd_t('|', Name) - ; memberd_t(';', Url) - ; memberd_t('|', Url) - ; memberd_t(';', Branch) - ; memberd_t('|', Branch)), - ( - Error = "the name, the url and the branch of dependency should not contain an \";\" or an \"|\" caracter", - M = validate_dependency(dependency(Name, git(Url, branch(Branch))))-error(Error), - user_message_malformed_dependency(dependency(Name, git(Url, branch(Branch))), Error) - ),( - M = validate_dependency(dependency(Name, git(Url, branch(Branch))))-success - ) - ) - }, - [M], - valid_dependencies(Ds). - -valid_dependencies([dependency(Name, git(Url, tag(Tag)))|Ds]) --> { - if_( - (memberd_t(';', Name) - ; memberd_t('|', Name) - ; memberd_t(';', Url) - ; memberd_t('|', Url) - ; memberd_t(';', Tag) - ; memberd_t('|', Tag)), - ( - Error = "the name, the url and the tag of dependency should not contain an \";\" or an \"|\" caracter", - M = validate_dependency(dependency(Name, git(Url, tag(Tag))))-error(Error), - user_message_malformed_dependency(dependency(Name, git(Url, tag(Tag))), Error) - ), - M = validate_dependency(dependency(Name, git(Url, tag(Tag))))-success - ) - }, - [M], - valid_dependencies(Ds). - -valid_dependencies([dependency(Name, git(Url, hash(Hash)))|Ds]) --> { - if_( - (memberd_t(';', Name) - ; memberd_t('|', Name) - ; memberd_t(';', Url) - ; memberd_t('|', Url) - ; memberd_t(';', Hash) - ; memberd_t('|', Hash)), - ( - Error = "the name, the url and the hash of dependency should not contain an \";\" or an \"|\" caracter", - M = validate_dependency(dependency(Name, git(Url, hash(Hash))))-error(Error), - user_message_malformed_dependency(dependency(Name, git(Url, hash(Hash))), Error) - ), - M = validate_dependency(dependency(Name, git(Url, hash(Hash))))-success - ) - }, - [M], - valid_dependencies(Ds). - -all_dependencies_valid_t([], true). -all_dependencies_valid_t([validate_dependency(_)-success| Vs], T) :- all_dependencies_valid_t(Vs, T). -all_dependencies_valid_t([validate_dependency(_)-error(_)| _], false). - - % A prolog file knowledge base represented as a list of terms prolog_kb_list(Stream) --> {read(Stream, Term), dif(Term, end_of_file)}, [Term], prolog_kb_list(Stream). prolog_kb_list(Stream) --> {read(Stream, Term), Term == end_of_file}, []. @@ -240,7 +138,7 @@ parse_manifest(Filename, Manifest) :- setup_call_cleanup( open(Filename, read, Stream), - once(phrase(prolog_kb_list(Stream), Manifest)), + catch(once(phrase(prolog_kb_list(Stream), Manifest)), error(E, I), throw(error_formating_of_manifest(E, I))), close(Stream) ). @@ -291,23 +189,18 @@ setenv("SHELL", "/bin/sh"), setenv("GIT_ADVICE", "0"), directory_files("scryer_libs/packages", Installed_Packages), - (member(dependencies(Deps), Manifest) -> - ( - phrase(valid_dependencies(Deps), Validation_Report), - if_(all_dependencies_valid_t(Validation_Report), - call_cleanup( - ( - logical_plan(Plan, Deps, Installed_Packages), - installation_execution(Plan, Installation_Report), - append(Validation_Report, Installation_Report, Report) - ), - delete_directory("scryer_libs/temp") - ), + if_(valid_manifest_t(Manifest, Validation_Report), + (member(dependencies(Deps), Manifest) -> + call_cleanup( ( - Report = Validation_Report - ) - ) - ); Report = [] + logical_plan(Plan, Deps, Installed_Packages), + installation_execution(Plan, Installation_Report), + append(Validation_Report, Installation_Report, Report) + ), + delete_directory("scryer_libs/temp") + ) ; Report = Validation_Report + ), + Report = Validation_Report ). % A logical plan to install the dependencies diff --git a/src/qupak.pl b/src/qupak.pl new file mode 100644 index 0000000..da4ede0 --- /dev/null +++ b/src/qupak.pl @@ -0,0 +1,254 @@ +% Qupak: Pattern Matching for library(reif) +% +% === Bibliographic Note === +% Author: KauĂȘ Hunnicutt Bazilli (https://github.com/bakaq) +% Original implementation: https://github.com/bakaq/qupak +% Git Commit Hash: 5ca7fc6ea82c74fb71a2204a8c43f16e97e14d8f +% +% Notes: +% - This version removes operators (e.g., ~>, |) for predicates +% to avoid shipping them in every project using Bakage. +% +% This library provides predicates to do pattern matching in a way that complements and +% expands on library(reif). +% +% Tested on Scryer Prolog 0.10. +% +% === Pattern matching === +% +% The core predicate of this library is pattern_match_t/3. It has a non-reified version +% pattern_match/2, along with predicate aliases pattern_match_rev/2-3 (value first order). +% +% The pattern consists of a term that is a clean representation of what you want to match. +% You always need to specify how a term will be matched with a wrapping functor. + +% --- ground: Ground term matching --- +% +% Matches a ground term. Doesn't need to be atomic. +% +% Examples: +% ?- pattern_match_rev(a(1,2,3), ground(a(1,2,3))). +% true. +% ?- pattern_match_rev(a(1,2,3), ground(a(1,2,3)), T). +% T = true. + +% --- bind: Bind variable --- +% +% Binds a variable. This does normal unification, not reified unification like check. +% +% Examples: +% ?- pattern_match_rev(a(1,2,3), bind(X)). +% X = a(1,2,3). +% ?- pattern_match_rev(a(1,2,3), bind(X), T). +% X = a(1,2,3), T = true. + +% --- check: Reified unification --- +% +% Does reified unification. If used in a non-reified predicate, it's basically the same +% thing as bind, but creates a spurious choice point. When used in a reified +% predicate, does the unification like =/3, exploring the dif/2 case on backtracking. +% +% Examples: +% ?- pattern_match_rev(a(1,2,3), check(X)). +% X = a(1,2,3) +% ; false. +% ?- pattern_match_rev(a(1,2,3), check(X), T). +% X = a(1,2,3), T = true +% ; T = false, dif:dif(X,a(1,2,3)). + +% --- any: Wildcard --- +% +% Matches anything, and ignores it. +% +% Examples: +% ?- pattern_match_rev(a(1,2,3), any). +% true. +% ?- pattern_match_rev(a(1,2,3), any, T). +% T = true. + +% --- composite: Compound term --- +% +% Matches a compound term, applying patterns recursively. If the compound term is ground, +% you can use ground instead. +% +% Examples: +% ?- pattern_match_rev(a(1,2,3,4), composite(a(ground(1), bind(A), check(B), any))). +% A = 2, B = 3 +% ; false. +% ?- pattern_match_rev(a(1,2,3,4), composite(a(ground(1), bind(A), check(B), any)), T). +% A = 2, B = 3, T = true +% ; A = 2, T = false, dif:dif(B,3). + +% --- bind_all: All binding --- +% +% Binds the whole pattern to a variable. It can be used at any nesting level, not just +% at the top level. +% +% Examples: +% ?- pattern_match_rev(a(1,2,3,4), bind_all(All, composite(a(ground(1), bind(A), check(B), any)))). +% All = a(1,2,3,4), A = 2, B = 3 +% ; false. +% ?- pattern_match_rev(a(1,2,3,4), bind_all(All, composite(a(ground(1), bind(A), check(B), any))), T). +% All = a(1,2,3,4), A = 2, B = 3, T = true +% ; All = a(1,2,3,4), A = 2, T = false, dif:dif(B,3). + +% --- guard: Guards --- +% +% Runs a reified predicate after the bindings to decide if the pattern matches. +% +% Examples: +% ?- use_module(library(clpz)). +% true. +% ?- pattern_match_rev(a(50), guard(composite(a(bind(N))), clpz_t(N #< 25))). +% false. +% ?- pattern_match_rev(a(10), guard(composite(a(bind(N))), clpz_t(N #< 25))). +% N = 10. +% ?- pattern_match_rev(a(50), guard(composite(a(bind(N))), clpz_t(N #< 25)), T). +% N = 50, T = false. +% ?- pattern_match_rev(a(10), guard(composite(a(bind(N))), clpz_t(N #< 25)), T). +% N = 10, T = true. + +% === match/2: Reified pattern matching switch === +% +% The match/2 predicate implements something like a switch/match statement on top of +% if_/3 and the pattern matching predicates from this library. The arms are matched in +% order, and the first one to succeed is the one taken. +% +% When a check pattern backtracks and tries the dif/2 case, it will test the next +% arms in the match/2. The dif/2 constraint will be available for all the arms +% from there on. +% +% Examples: +% example_match(Term, Out) :- +% match(Term, [ +% arm(ground(a), (Out = 1)), +% arm(composite(b(bind(N))), (Out = N)), +% arm(composite(c(check(N))), (Out = N)), +% arm(any, (Out = wildcard)) +% ]). +% +% ?- example_match(a, Out). +% Out = 1. +% ?- example_match(b(10), Out). +% Out = 10. +% ?- example_match(c(10), Out). +% Out = 10 +% ; Out = wildcard, dif:dif(_A,10). + +% === Migration from operator version === +% +% Old operator syntax -> New predicate syntax: +% +Term -> ground(Term) +% -Var -> bind(Var) +% ?Var -> check(Var) +% * -> any +% \Structure -> composite(Structure) +% All << Pattern -> bind_all(All, Pattern) +% Pattern | Guard -> guard(Pattern, Guard) +% Pattern ~> Goal -> arm(Pattern, Goal) +% Value =~ Pattern -> pattern_match_rev(Value, Pattern) +% Pattern ~= Value -> pattern_match(Pattern, Value) + +:- use_module(library(reif)). +:- use_module(library(lists)). +:- use_module(library(dcgs)). + +% === Helper predicates === + +and(true, true, true). +and(true, false, false). +and(false, true, false). +and(false, false, false). + +%% pattern_match_rev(Value, Pattern) - emulates Value =~ Pattern +pattern_match_rev(Value, Pattern, T) :- + pattern_match_t(Pattern, Value, T). +pattern_match_rev(Value, Pattern) :- + pattern_match_t(Pattern, Value, true). + +%% pattern_match(Pattern, Value) - emulates Pattern ~= Value +pattern_match(Pattern, Value, T) :- + pattern_match_t(Pattern, Value, T). +pattern_match(Pattern, Value) :- + pattern_match_t(Pattern, Value, true). + +%% pattern_match_t(Pattern, Value, T). +% +% A predicate to check if a value matches a certain pattern. +% The pattern is a specially constructed term that describes +% a pattern so that this can be monotonic. +pattern_match_t(Pattern, Value, T) :- + % TODO: Error handling of pattern arity. + Pattern =.. [PatternKind|PatternArgs], + inner_pattern_match(PatternKind, PatternArgs, Value, T). + +% Pattern constructors - emulate the symbol operators +% any - emulates * +inner_pattern_match(any, [], _, true). + +% bind - emulates - +inner_pattern_match(bind, [Variable], Value, true) :- + Variable = Value. + +% check - emulates ? +inner_pattern_match(check, [Variable], Value, T) :- + =(Variable, Value, T). + +% ground - emulates + +inner_pattern_match(ground, [Ground], Value, T) :- + % TODO: Error handling + ground(Ground), + =(Ground, Value, T). + +% composite - emulates \ +inner_pattern_match(composite, [Composite], Value, T) :- + Composite =.. [Functor|Args], + length(Args, Arity), + functor(Value, ValueFunctor, ValueArity), + if_( + Functor = ValueFunctor, + if_( + Arity = ValueArity, + ( + Value =.. [_|ValueArgs], + pattern_match_arguments(Args, ValueArgs, true, T) + ), + T = false + ), + T = false + ). + +% bind_all - emulates +inner_pattern_match(bind_all, [Variable, Pattern], Value, T) :- + Variable = Value, + pattern_match_t(Pattern, Value, T). + +% guard - emulates | in patterns +inner_pattern_match(guard, [Pattern, Guard_1], Value, T) :- + if_( + pattern_match_t(Pattern, Value), + call(Guard_1, T), + T = false + ). + +pattern_match_arguments([], [], T, T). +pattern_match_arguments([Pattern|Patterns], [Arg|Args], T0, T) :- + pattern_match_t(Pattern, Arg, T1), + and(T0, T1, T2), + pattern_match_arguments(Patterns, Args, T2, T). + +% === match/2 predicate === + +%% match(Term, Arms) +% Pattern matching with multiple arms. +% Arms should be a list of arm(Pattern, Goal) terms +match(Term,Arms) :- + match_run(Arms, Term). + +match_run([], _) :- false. +match_run([arm(Pattern, Goal_0)|Arms], Term) :- + if_( + pattern_match_rev(Term, Pattern), + call(Goal_0), + match_run(Arms, Term) + ). diff --git a/src/validation.pl b/src/validation.pl new file mode 100644 index 0000000..0b0a14d --- /dev/null +++ b/src/validation.pl @@ -0,0 +1,237 @@ +:- use_module(library(lists)). +:- use_module(library(reif)). +:- use_module(library(debug)). +:- use_module(library(files)). + +is_list_t(Ls, T) :- + match(Ls, [ + arm(ground([]), (T = true)), + arm(composite([any | bind(Ls1)]), is_list_t(Ls1, T)), + arm(any, (T = false)) + ]). + + +file_exists_t(P, true):- file_exists(P),!. +file_exists_t(_, false). + +license_t_(license(name(N)), T):- is_list_t(N, T). + +license_t_(license(name(N), path(P)), T) :- + call((is_list_t(N), is_list_t(P)), T). + +license_valid_path_t([], Result1, Result1). +license_valid_path_t([_,_|_], Result1, Result1). +license_valid_path_t([license(name(_))], Result1, Result1). +license_valid_path_t([license(name(_), path(P))], Result1, Result2):- + if_(file_exists_t(P), + (Result2 = Result1), + (Result2 = error("the path of the license is not valid")) + ). + +license_t(X, T) :- + match(X, [ + arm(composite(license(bind(N))), (license_t_(license(N), T))), + arm(composite(license(bind(N), bind(P))), (license_t_(license(N, P), T))), + arm(any, (T = false)) + ]). + +name_t(X, T) :- + match(X, [ + arm(composite(name(bind(N))), (is_list_t(N, T))), + arm(any, (T = false)) + ]). + +dependencies_t(X, T) :- + match(X, [ + arm(composite(dependencies(bind(N))), (is_list_t(N, T))), + arm(any, (T = false)) + ]). + +main_file_t(X, T) :- + match(X, [ + arm(composite(main_file(bind(N))), (is_list_t(N, T))), + arm(any, (T = false)) + ]). + +pattern_in_list([], _) --> []. + +pattern_in_list([L|Ls], Pattern_t) --> + { + if_(call(Pattern_t, L), + Match = [L], + Match = [] + ) + }, + Match, + pattern_in_list(Ls, Pattern_t). + +% A valid manifest +valid_manifest_t(Manifest, Report, Valid) :- + has_valid_name(Manifest, ValidName), + has_valid_optional_main_file(Manifest, ValidMainFile), + has_license(Manifest, ValidLicense), + has_optional_dependencies(Manifest, ValidDendencies), + if_((ValidName=success, ValidMainFile=success, ValidLicense=success, ValidDendencies=success), + if_(memberd_t(dependencies(Deps), Manifest), + ( + phrase(valid_dependencies(Deps), DepsReport), + if_(all_dependencies_valid_t(DepsReport), + ( + Report = [validate_manifest-success], + Valid=true + ), + ( + Report = DepsReport, + Valid=false + ) + ) + ), + ( + Report = [validate_manifest-success], + Valid = true + ) + + ), + ( + Report = [ + validate_manifest_name-ValidName, + validate_manifest_main_file-ValidMainFile, + validate_manifest_license-ValidLicense, + validate_dependencies-ValidDendencies + ], + Valid = false + ) + + ). + +% Is valid when there is 0 instance and the field is optional +has_a_field([], _, _, true, success). + +% Is not valid when there is 0 instance and the field is not optional +has_a_field([], FieldName, PredicateForm, false, error(Es)):- + phrase(format_("the '~s' of the package is not defined or does not have the a predicate of the form '~s'", [FieldName, PredicateForm]), Es). + +% Is valid when there is one instance of the field and the field value has the correct type +has_a_field([_], _, _, _, success). + +% Is not valid when there are multiple instances of the field +has_a_field([_,_|_], FieldName, _, _, error(Es)):- + phrase(format_("the package has multiple '~s'", [FieldName]), Es). + +has_valid_name(Manifest, Result):- + phrase(pattern_in_list(Manifest, name_t), S), + has_a_field(S, "name", "name(N)", false, Result). + +has_valid_optional_main_file(Manifest, Result) :- + phrase(pattern_in_list(Manifest, main_file_t), S), + has_a_field(S, "main_file", "main_file(N)", true, Result). + +has_license(Manifest, Result) :- + phrase(pattern_in_list(Manifest, license_t), S), + has_a_field(S, "license", "license(name(N));license(name(N), path(P))", false, Result1), + license_valid_path_t(S, Result1, Result). + +has_optional_dependencies(Manifest, Result):- + phrase(pattern_in_list(Manifest, dependencies_t), S), + has_a_field(S, "dependencies", "dependencies(D)", true, Result). + +% A valid dependency +valid_dependencies([]) --> []. + +valid_dependencies([dependency(Name, path(Path))| Ds]) --> { + if_( + (memberd_t(';', Name) + ; memberd_t('|', Name) + ; memberd_t(';', Path) + ; memberd_t('|', Path) + ), + ( + Error = "the name and the path of the dependency should not contain an \";\" or an \"|\" caracter", + M = validate_dependency(dependency(Name, path(Path)))-error(Error), + user_message_malformed_dependency(dependency(Name, path(Path)), Error) + ), + M = validate_dependency(dependency(Name, path(Path)))-success + ) + }, + [M], + valid_dependencies(Ds). + +valid_dependencies([dependency(Name, git(Url))| Ds]) --> { + if_( + (memberd_t(';', Name) + ; memberd_t('|', Name) + ; memberd_t(';', Url) + ; memberd_t('|', Url) + ), + ( + Error = "the name of the dependency and the url should not contain an \";\" or an \"|\" caracter", + M = validate_dependency(dependency(Name, git(Url)))-error(Error), + user_message_malformed_dependency(dependency(Name, git(Url)), Error) + ), + M = validate_dependency(dependency(Name, git(Url)))-success + ) + }, + [M], + valid_dependencies(Ds). + +valid_dependencies([dependency(Name, git(Url, branch(Branch)))| Ds]) --> { + if_( + (memberd_t(';', Name) + ; memberd_t('|', Name) + ; memberd_t(';', Url) + ; memberd_t('|', Url) + ; memberd_t(';', Branch) + ; memberd_t('|', Branch)), + ( + Error = "the name, the url and the branch of dependency should not contain an \";\" or an \"|\" caracter", + M = validate_dependency(dependency(Name, git(Url, branch(Branch))))-error(Error), + user_message_malformed_dependency(dependency(Name, git(Url, branch(Branch))), Error) + ),( + M = validate_dependency(dependency(Name, git(Url, branch(Branch))))-success + ) + ) + }, + [M], + valid_dependencies(Ds). + +valid_dependencies([dependency(Name, git(Url, tag(Tag)))|Ds]) --> { + if_( + (memberd_t(';', Name) + ; memberd_t('|', Name) + ; memberd_t(';', Url) + ; memberd_t('|', Url) + ; memberd_t(';', Tag) + ; memberd_t('|', Tag)), + ( + Error = "the name, the url and the tag of dependency should not contain an \";\" or an \"|\" caracter", + M = validate_dependency(dependency(Name, git(Url, tag(Tag))))-error(Error), + user_message_malformed_dependency(dependency(Name, git(Url, tag(Tag))), Error) + ), + M = validate_dependency(dependency(Name, git(Url, tag(Tag))))-success + ) + }, + [M], + valid_dependencies(Ds). + +valid_dependencies([dependency(Name, git(Url, hash(Hash)))|Ds]) --> { + if_( + (memberd_t(';', Name) + ; memberd_t('|', Name) + ; memberd_t(';', Url) + ; memberd_t('|', Url) + ; memberd_t(';', Hash) + ; memberd_t('|', Hash)), + ( + Error = "the name, the url and the hash of dependency should not contain an \";\" or an \"|\" caracter", + M = validate_dependency(dependency(Name, git(Url, hash(Hash))))-error(Error), + user_message_malformed_dependency(dependency(Name, git(Url, hash(Hash))), Error) + ), + M = validate_dependency(dependency(Name, git(Url, hash(Hash))))-success + ) + }, + [M], + valid_dependencies(Ds). + +all_dependencies_valid_t([], true). +all_dependencies_valid_t([validate_dependency(_)-success| Vs], T) :- all_dependencies_valid_t(Vs, T). +all_dependencies_valid_t([validate_dependency(_)-error(_)| _], false). diff --git a/tests/integration/all_invalid_dependencies_stop_installation/scryer-manifest.pl b/tests/integration/all_invalid_dependencies_stop_installation/scryer-manifest.pl index fbb5505..d3d29db 100644 --- a/tests/integration/all_invalid_dependencies_stop_installation/scryer-manifest.pl +++ b/tests/integration/all_invalid_dependencies_stop_installation/scryer-manifest.pl @@ -1,10 +1,10 @@ name("name_of_the_package"). main_file("main.pl"). - +license(name("UNLICENSE")). dependencies([ dependency("test", git("https://github.com/constraintAutomaton/test-prolog-package-manager.git|abc")), dependency("test_branch", git("https://github.com/constraintAutomaton/test-prolog-package-manager.git", branch("branch;"))), dependency("test_tag", git("https://github.com/constraintAutomaton/test-prolog-package-manager.git|", tag("tag|"))), dependency("test_hash", git("https://github.com/constraintAutomaton/test-prolog-package-manager.git;", hash("d19fefc1d7907f6675e181601bb9b8b94561b441|def"))), dependency("test_local", path("./local_packa|ge")) -]). \ No newline at end of file +]). diff --git a/tests/integration/invalid_manifest_invalid_license_path/.gitignore b/tests/integration/invalid_manifest_invalid_license_path/.gitignore new file mode 100644 index 0000000..36963fd --- /dev/null +++ b/tests/integration/invalid_manifest_invalid_license_path/.gitignore @@ -0,0 +1 @@ +scryer_libs \ No newline at end of file diff --git a/tests/integration/invalid_manifest_invalid_license_path/bakage.pl b/tests/integration/invalid_manifest_invalid_license_path/bakage.pl new file mode 120000 index 0000000..fcd6e40 --- /dev/null +++ b/tests/integration/invalid_manifest_invalid_license_path/bakage.pl @@ -0,0 +1 @@ +../../../build/bakage.pl \ No newline at end of file diff --git a/tests/integration/invalid_manifest_invalid_license_path/justfile b/tests/integration/invalid_manifest_invalid_license_path/justfile new file mode 100644 index 0000000..88272e6 --- /dev/null +++ b/tests/integration/invalid_manifest_invalid_license_path/justfile @@ -0,0 +1,24 @@ +test: + #!/bin/sh + + set -eu + . ../../utils/report_test.sh + + printf "%s\n" "Testing invalid manifest with invalid license path" + + rm -rf scryer_libs && rm -f manifest-lock.pl + scryer-prolog main.pl -g "catch(main, _, halt(1)) ." + + exitCode=0 + + if [ ! -d "./scryer_libs/packages/test" ]; then + print_test_result "the package folder does not exist in the dependencies" success + else + exitCode=1 + print_test_result "the package folder does not exist in the dependencies" failure + fi + + + rm -rf scryer_libs && rm -f manifest-lock.pl + + exit ${exitCode} diff --git a/tests/integration/invalid_manifest_invalid_license_path/main.pl b/tests/integration/invalid_manifest_invalid_license_path/main.pl new file mode 100644 index 0000000..aae6093 --- /dev/null +++ b/tests/integration/invalid_manifest_invalid_license_path/main.pl @@ -0,0 +1,20 @@ +:- use_module(bakage). +:- use_module('../../utils/testing.pl'). +:- use_module('../../utils/assert.pl'). +:- use_module(library(pio)). +:- use_module(library(format)). + +main :- + run_tests. + +test("the package report is valid", ( + pkg_install(X), + Expected = [ + validate_manifest_name-success, + validate_manifest_main_file-success, + validate_manifest_license-error("the path of the license is not valid"), + validate_dependencies-success + ], + test_eq(X, Expected) + ) +). diff --git a/tests/integration/invalid_manifest_invalid_license_path/scryer-manifest.pl b/tests/integration/invalid_manifest_invalid_license_path/scryer-manifest.pl new file mode 100644 index 0000000..35efd27 --- /dev/null +++ b/tests/integration/invalid_manifest_invalid_license_path/scryer-manifest.pl @@ -0,0 +1,6 @@ +name("name_of_the_package"). +main_file("main.pl"). +license(name("UNLICENSE"), path("./do_not_exist")). +dependencies([ + dependency("test", git("https://github.com/constraintAutomaton/test-prolog-package-manager.git")) +]). diff --git a/tests/integration/invalid_manifest_missing_license/.gitignore b/tests/integration/invalid_manifest_missing_license/.gitignore new file mode 100644 index 0000000..36963fd --- /dev/null +++ b/tests/integration/invalid_manifest_missing_license/.gitignore @@ -0,0 +1 @@ +scryer_libs \ No newline at end of file diff --git a/tests/integration/invalid_manifest_missing_license/bakage.pl b/tests/integration/invalid_manifest_missing_license/bakage.pl new file mode 120000 index 0000000..fcd6e40 --- /dev/null +++ b/tests/integration/invalid_manifest_missing_license/bakage.pl @@ -0,0 +1 @@ +../../../build/bakage.pl \ No newline at end of file diff --git a/tests/integration/invalid_manifest_missing_license/justfile b/tests/integration/invalid_manifest_missing_license/justfile new file mode 100644 index 0000000..6c25c17 --- /dev/null +++ b/tests/integration/invalid_manifest_missing_license/justfile @@ -0,0 +1,24 @@ +test: + #!/bin/sh + + set -eu + . ../../utils/report_test.sh + + printf "%s\n" "Testing invalid manifest with a missing license" + + rm -rf scryer_libs && rm -f manifest-lock.pl + scryer-prolog main.pl -g "catch(main, _, halt(1)) ." + + exitCode=0 + + if [ ! -d "./scryer_libs/packages/test" ]; then + print_test_result "the package folder does not exist in the dependencies" success + else + exitCode=1 + print_test_result "the package folder does not exist in the dependencies" failure + fi + + + rm -rf scryer_libs && rm -f manifest-lock.pl + + exit ${exitCode} diff --git a/tests/integration/invalid_manifest_missing_license/main.pl b/tests/integration/invalid_manifest_missing_license/main.pl new file mode 100644 index 0000000..1eb22d6 --- /dev/null +++ b/tests/integration/invalid_manifest_missing_license/main.pl @@ -0,0 +1,20 @@ +:- use_module(bakage). +:- use_module('../../utils/testing.pl'). +:- use_module('../../utils/assert.pl'). +:- use_module(library(pio)). +:- use_module(library(format)). + +main :- + run_tests. + +test("the package report is valid", ( + pkg_install(X), + Expected = [ + validate_manifest_name-success, + validate_manifest_main_file-success, + validate_manifest_license-error("the \'license\' of the package is not defined or does not have the a predicate of the form \'license(name(N));license(name(N), path(P))\'"), + validate_dependencies-success + ], + test_eq(X, Expected) + ) +). diff --git a/tests/integration/invalid_manifest_missing_license/scryer-manifest.pl b/tests/integration/invalid_manifest_missing_license/scryer-manifest.pl new file mode 100644 index 0000000..bb15f38 --- /dev/null +++ b/tests/integration/invalid_manifest_missing_license/scryer-manifest.pl @@ -0,0 +1,5 @@ +name("name_of_the_package"). +main_file("main.pl"). +dependencies([ + dependency("test", git("https://github.com/constraintAutomaton/test-prolog-package-manager.git")) +]). diff --git a/tests/integration/invalid_manifest_missing_name/.gitignore b/tests/integration/invalid_manifest_missing_name/.gitignore new file mode 100644 index 0000000..36963fd --- /dev/null +++ b/tests/integration/invalid_manifest_missing_name/.gitignore @@ -0,0 +1 @@ +scryer_libs \ No newline at end of file diff --git a/tests/integration/invalid_manifest_missing_name/bakage.pl b/tests/integration/invalid_manifest_missing_name/bakage.pl new file mode 120000 index 0000000..fcd6e40 --- /dev/null +++ b/tests/integration/invalid_manifest_missing_name/bakage.pl @@ -0,0 +1 @@ +../../../build/bakage.pl \ No newline at end of file diff --git a/tests/integration/invalid_manifest_missing_name/justfile b/tests/integration/invalid_manifest_missing_name/justfile new file mode 100644 index 0000000..a99d8f2 --- /dev/null +++ b/tests/integration/invalid_manifest_missing_name/justfile @@ -0,0 +1,24 @@ +test: + #!/bin/sh + + set -eu + . ../../utils/report_test.sh + + printf "%s\n" "Testing invalid manifest with a missing name" + + rm -rf scryer_libs && rm -f manifest-lock.pl + scryer-prolog main.pl -g "catch(main, _, halt(1)) ." + + exitCode=0 + + if [ ! -d "./scryer_libs/packages/test" ]; then + print_test_result "the package folder does not exist in the dependencies" success + else + exitCode=1 + print_test_result "the package folder does not exist in the dependencies" failure + fi + + + rm -rf scryer_libs && rm -f manifest-lock.pl + + exit ${exitCode} diff --git a/tests/integration/invalid_manifest_missing_name/main.pl b/tests/integration/invalid_manifest_missing_name/main.pl new file mode 100644 index 0000000..02c7a86 --- /dev/null +++ b/tests/integration/invalid_manifest_missing_name/main.pl @@ -0,0 +1,20 @@ +:- use_module(bakage). +:- use_module('../../utils/testing.pl'). +:- use_module('../../utils/assert.pl'). +:- use_module(library(pio)). +:- use_module(library(format)). + +main :- + run_tests. + +test("the package report is valid", ( + pkg_install(X), + Expected = [ + validate_manifest_name-error("the \'name\' of the package is not defined or does not have the a predicate of the form \'name(N)\'"), + validate_manifest_main_file-success, + validate_manifest_license-success, + validate_dependencies-success + ], + test_eq(X, Expected) + ) +). diff --git a/tests/integration/invalid_manifest_missing_name/scryer-manifest.pl b/tests/integration/invalid_manifest_missing_name/scryer-manifest.pl new file mode 100644 index 0000000..6d8211b --- /dev/null +++ b/tests/integration/invalid_manifest_missing_name/scryer-manifest.pl @@ -0,0 +1,5 @@ +main_file("main.pl"). +license(name("UNLICENSE")). +dependencies([ + dependency("test", git("https://github.com/constraintAutomaton/test-prolog-package-manager.git")) +]). diff --git a/tests/integration/invalid_manifest_multiple_licenses/.gitignore b/tests/integration/invalid_manifest_multiple_licenses/.gitignore new file mode 100644 index 0000000..36963fd --- /dev/null +++ b/tests/integration/invalid_manifest_multiple_licenses/.gitignore @@ -0,0 +1 @@ +scryer_libs \ No newline at end of file diff --git a/tests/integration/invalid_manifest_multiple_licenses/bakage.pl b/tests/integration/invalid_manifest_multiple_licenses/bakage.pl new file mode 120000 index 0000000..fcd6e40 --- /dev/null +++ b/tests/integration/invalid_manifest_multiple_licenses/bakage.pl @@ -0,0 +1 @@ +../../../build/bakage.pl \ No newline at end of file diff --git a/tests/integration/invalid_manifest_multiple_licenses/justfile b/tests/integration/invalid_manifest_multiple_licenses/justfile new file mode 100644 index 0000000..d2ddf88 --- /dev/null +++ b/tests/integration/invalid_manifest_multiple_licenses/justfile @@ -0,0 +1,24 @@ +test: + #!/bin/sh + + set -eu + . ../../utils/report_test.sh + + printf "%s\n" "Testing invalid manifest with multiple licenses" + + rm -rf scryer_libs && rm -f manifest-lock.pl + scryer-prolog main.pl -g "catch(main, _, halt(1)) ." + + exitCode=0 + + if [ ! -d "./scryer_libs/packages/test" ]; then + print_test_result "the package folder does not exist in the dependencies" success + else + exitCode=1 + print_test_result "the package folder does not exist in the dependencies" failure + fi + + + rm -rf scryer_libs && rm -f manifest-lock.pl + + exit ${exitCode} diff --git a/tests/integration/invalid_manifest_multiple_licenses/main.pl b/tests/integration/invalid_manifest_multiple_licenses/main.pl new file mode 100644 index 0000000..3f18367 --- /dev/null +++ b/tests/integration/invalid_manifest_multiple_licenses/main.pl @@ -0,0 +1,20 @@ +:- use_module(bakage). +:- use_module('../../utils/testing.pl'). +:- use_module('../../utils/assert.pl'). +:- use_module(library(pio)). +:- use_module(library(format)). + +main :- + run_tests. + +test("the package report is valid", ( + pkg_install(X), + Expected = [ + validate_manifest_name-success, + validate_manifest_main_file-success, + validate_manifest_license-error("the package has multiple 'license'"), + validate_dependencies-success + ], + test_eq(X, Expected) + ) +). diff --git a/tests/integration/invalid_manifest_multiple_licenses/scryer-manifest.pl b/tests/integration/invalid_manifest_multiple_licenses/scryer-manifest.pl new file mode 100644 index 0000000..3a64b6f --- /dev/null +++ b/tests/integration/invalid_manifest_multiple_licenses/scryer-manifest.pl @@ -0,0 +1,7 @@ +name("name_of_the_package"). +main_file("main.pl"). +license(name("UNLICENSE")). +license(name("LICENSE")). +dependencies([ + dependency("test", git("https://github.com/constraintAutomaton/test-prolog-package-manager.git")) +]). diff --git a/tests/integration/invalid_manifest_multiple_licenses_multiple_types/.gitignore b/tests/integration/invalid_manifest_multiple_licenses_multiple_types/.gitignore new file mode 100644 index 0000000..36963fd --- /dev/null +++ b/tests/integration/invalid_manifest_multiple_licenses_multiple_types/.gitignore @@ -0,0 +1 @@ +scryer_libs \ No newline at end of file diff --git a/tests/integration/invalid_manifest_multiple_licenses_multiple_types/bakage.pl b/tests/integration/invalid_manifest_multiple_licenses_multiple_types/bakage.pl new file mode 120000 index 0000000..fcd6e40 --- /dev/null +++ b/tests/integration/invalid_manifest_multiple_licenses_multiple_types/bakage.pl @@ -0,0 +1 @@ +../../../build/bakage.pl \ No newline at end of file diff --git a/tests/integration/invalid_manifest_multiple_licenses_multiple_types/justfile b/tests/integration/invalid_manifest_multiple_licenses_multiple_types/justfile new file mode 100644 index 0000000..045f2ca --- /dev/null +++ b/tests/integration/invalid_manifest_multiple_licenses_multiple_types/justfile @@ -0,0 +1,24 @@ +test: + #!/bin/sh + + set -eu + . ../../utils/report_test.sh + + printf "%s\n" "Testing invalid manifest with multiple licenses of multiple types" + + rm -rf scryer_libs && rm -f manifest-lock.pl + scryer-prolog main.pl -g "catch(main, _, halt(1)) ." + + exitCode=0 + + if [ ! -d "./scryer_libs/packages/test" ]; then + print_test_result "the package folder does not exist in the dependencies" success + else + exitCode=1 + print_test_result "the package folder does not exist in the dependencies" failure + fi + + + rm -rf scryer_libs && rm -f manifest-lock.pl + + exit ${exitCode} diff --git a/tests/integration/invalid_manifest_multiple_licenses_multiple_types/license b/tests/integration/invalid_manifest_multiple_licenses_multiple_types/license new file mode 100644 index 0000000..579755f --- /dev/null +++ b/tests/integration/invalid_manifest_multiple_licenses_multiple_types/license @@ -0,0 +1 @@ +this is a license diff --git a/tests/integration/invalid_manifest_multiple_licenses_multiple_types/main.pl b/tests/integration/invalid_manifest_multiple_licenses_multiple_types/main.pl new file mode 100644 index 0000000..3f18367 --- /dev/null +++ b/tests/integration/invalid_manifest_multiple_licenses_multiple_types/main.pl @@ -0,0 +1,20 @@ +:- use_module(bakage). +:- use_module('../../utils/testing.pl'). +:- use_module('../../utils/assert.pl'). +:- use_module(library(pio)). +:- use_module(library(format)). + +main :- + run_tests. + +test("the package report is valid", ( + pkg_install(X), + Expected = [ + validate_manifest_name-success, + validate_manifest_main_file-success, + validate_manifest_license-error("the package has multiple 'license'"), + validate_dependencies-success + ], + test_eq(X, Expected) + ) +). diff --git a/tests/integration/invalid_manifest_multiple_licenses_multiple_types/scryer-manifest.pl b/tests/integration/invalid_manifest_multiple_licenses_multiple_types/scryer-manifest.pl new file mode 100644 index 0000000..fc3cabf --- /dev/null +++ b/tests/integration/invalid_manifest_multiple_licenses_multiple_types/scryer-manifest.pl @@ -0,0 +1,7 @@ +name("name_of_the_package"). +main_file("main.pl"). +license(name("UNLICENSE")). +license(name("UNLICENSE"), path("./license")). +dependencies([ + dependency("test", git("https://github.com/constraintAutomaton/test-prolog-package-manager.git")) +]). diff --git a/tests/integration/invalid_manifest_multiple_main_file/.gitignore b/tests/integration/invalid_manifest_multiple_main_file/.gitignore new file mode 100644 index 0000000..36963fd --- /dev/null +++ b/tests/integration/invalid_manifest_multiple_main_file/.gitignore @@ -0,0 +1 @@ +scryer_libs \ No newline at end of file diff --git a/tests/integration/invalid_manifest_multiple_main_file/bakage.pl b/tests/integration/invalid_manifest_multiple_main_file/bakage.pl new file mode 120000 index 0000000..fcd6e40 --- /dev/null +++ b/tests/integration/invalid_manifest_multiple_main_file/bakage.pl @@ -0,0 +1 @@ +../../../build/bakage.pl \ No newline at end of file diff --git a/tests/integration/invalid_manifest_multiple_main_file/justfile b/tests/integration/invalid_manifest_multiple_main_file/justfile new file mode 100644 index 0000000..84f444a --- /dev/null +++ b/tests/integration/invalid_manifest_multiple_main_file/justfile @@ -0,0 +1,24 @@ +test: + #!/bin/sh + + set -eu + . ../../utils/report_test.sh + + printf "%s\n" "Testing invalid manifest with multiple main files" + + rm -rf scryer_libs && rm -f manifest-lock.pl + scryer-prolog main.pl -g "catch(main, _, halt(1)) ." + + exitCode=0 + + if [ ! -d "./scryer_libs/packages/test" ]; then + print_test_result "the package folder does not exist in the dependencies" success + else + exitCode=1 + print_test_result "the package folder does not exist in the dependencies" failure + fi + + + rm -rf scryer_libs && rm -f manifest-lock.pl + + exit ${exitCode} diff --git a/tests/integration/invalid_manifest_multiple_main_file/main.pl b/tests/integration/invalid_manifest_multiple_main_file/main.pl new file mode 100644 index 0000000..d10af7b --- /dev/null +++ b/tests/integration/invalid_manifest_multiple_main_file/main.pl @@ -0,0 +1,20 @@ +:- use_module(bakage). +:- use_module('../../utils/testing.pl'). +:- use_module('../../utils/assert.pl'). +:- use_module(library(pio)). +:- use_module(library(format)). + +main :- + run_tests. + +test("the package report is valid", ( + pkg_install(X), + Expected = [ + validate_manifest_name-success, + validate_manifest_main_file-error("the package has multiple 'main_file'"), + validate_manifest_license-success, + validate_dependencies-success + ], + test_eq(X, Expected) + ) +). diff --git a/tests/integration/invalid_manifest_multiple_main_file/scryer-manifest.pl b/tests/integration/invalid_manifest_multiple_main_file/scryer-manifest.pl new file mode 100644 index 0000000..9ccb67d --- /dev/null +++ b/tests/integration/invalid_manifest_multiple_main_file/scryer-manifest.pl @@ -0,0 +1,7 @@ +name("name_of_the_package"). +main_file("main.pl"). +main_file("main_alt.pl"). +license(name("UNLICENSE")). +dependencies([ + dependency("test", git("https://github.com/constraintAutomaton/test-prolog-package-manager.git")) +]). diff --git a/tests/integration/invalid_manifest_multiple_name/.gitignore b/tests/integration/invalid_manifest_multiple_name/.gitignore new file mode 100644 index 0000000..36963fd --- /dev/null +++ b/tests/integration/invalid_manifest_multiple_name/.gitignore @@ -0,0 +1 @@ +scryer_libs \ No newline at end of file diff --git a/tests/integration/invalid_manifest_multiple_name/bakage.pl b/tests/integration/invalid_manifest_multiple_name/bakage.pl new file mode 120000 index 0000000..fcd6e40 --- /dev/null +++ b/tests/integration/invalid_manifest_multiple_name/bakage.pl @@ -0,0 +1 @@ +../../../build/bakage.pl \ No newline at end of file diff --git a/tests/integration/invalid_manifest_multiple_name/justfile b/tests/integration/invalid_manifest_multiple_name/justfile new file mode 100644 index 0000000..f853b57 --- /dev/null +++ b/tests/integration/invalid_manifest_multiple_name/justfile @@ -0,0 +1,24 @@ +test: + #!/bin/sh + + set -eu + . ../../utils/report_test.sh + + printf "%s\n" "Testing invalid manifest with multiple names" + + rm -rf scryer_libs && rm -f manifest-lock.pl + scryer-prolog main.pl -g "catch(main, _, halt(1)) ." + + exitCode=0 + + if [ ! -d "./scryer_libs/packages/test" ]; then + print_test_result "the package folder does not exist in the dependencies" success + else + exitCode=1 + print_test_result "the package folder does not exist in the dependencies" failure + fi + + + rm -rf scryer_libs && rm -f manifest-lock.pl + + exit ${exitCode} diff --git a/tests/integration/invalid_manifest_multiple_name/main.pl b/tests/integration/invalid_manifest_multiple_name/main.pl new file mode 100644 index 0000000..fc86810 --- /dev/null +++ b/tests/integration/invalid_manifest_multiple_name/main.pl @@ -0,0 +1,20 @@ +:- use_module(bakage). +:- use_module('../../utils/testing.pl'). +:- use_module('../../utils/assert.pl'). +:- use_module(library(pio)). +:- use_module(library(format)). + +main :- + run_tests. + +test("the package report is valid", ( + pkg_install(X), + Expected = [ + validate_manifest_name-error("the package has multiple 'name'"), + validate_manifest_main_file-success, + validate_manifest_license-success, + validate_dependencies-success + ], + test_eq(X, Expected) + ) +). diff --git a/tests/integration/invalid_manifest_multiple_name/scryer-manifest.pl b/tests/integration/invalid_manifest_multiple_name/scryer-manifest.pl new file mode 100644 index 0000000..bc2191a --- /dev/null +++ b/tests/integration/invalid_manifest_multiple_name/scryer-manifest.pl @@ -0,0 +1,7 @@ +name("name_of_the_package"). +name("name_of_the_package_2"). +main_file("main.pl"). +license(name("UNLICENSE")). +dependencies([ + dependency("test", git("https://github.com/constraintAutomaton/test-prolog-package-manager.git")) +]). diff --git a/tests/integration/manifest_multiple_dependencies/main.pl b/tests/integration/manifest_multiple_dependencies/main.pl index e51b313..cf27296 100644 --- a/tests/integration/manifest_multiple_dependencies/main.pl +++ b/tests/integration/manifest_multiple_dependencies/main.pl @@ -8,15 +8,11 @@ main :- run_tests. - + test("the package report is valid", ( pkg_install(X), list_to_ord_set([ - validate_dependency(dependency("test", git("https://github.com/constraintAutomaton/test-prolog-package-manager.git")))-success, - validate_dependency(dependency("test_branch", git("https://github.com/constraintAutomaton/test-prolog-package-manager.git", branch("branch"))))-success, - validate_dependency(dependency("test_tag", git("https://github.com/constraintAutomaton/test-prolog-package-manager.git", tag("tag"))))-success, - validate_dependency(dependency("test_hash", git("https://github.com/constraintAutomaton/test-prolog-package-manager.git", hash("d19fefc1d7907f6675e181601bb9b8b94561b441"))))-success, - validate_dependency(dependency("test_local", path("./local_package")))-success, + validate_manifest-success, install_dependency(dependency("test", git("https://github.com/constraintAutomaton/test-prolog-package-manager.git")))-success, install_dependency(dependency("test_branch", git("https://github.com/constraintAutomaton/test-prolog-package-manager.git", branch("branch"))))-success, @@ -27,4 +23,4 @@ list_to_ord_set(X, X_Set), test_eq(X_Set, Expected) ) -). \ No newline at end of file +). diff --git a/tests/integration/manifest_multiple_dependencies/scryer-manifest.pl b/tests/integration/manifest_multiple_dependencies/scryer-manifest.pl index 5e54d4f..fc17c75 100644 --- a/tests/integration/manifest_multiple_dependencies/scryer-manifest.pl +++ b/tests/integration/manifest_multiple_dependencies/scryer-manifest.pl @@ -1,6 +1,6 @@ name("name_of_the_package"). main_file("main.pl"). - +license(name("UNLICENSE")). dependencies([ dependency("test", git("https://github.com/constraintAutomaton/test-prolog-package-manager.git")), dependency("test_branch", git("https://github.com/constraintAutomaton/test-prolog-package-manager.git", branch("branch"))), diff --git a/tests/integration/manifest_multiple_dependencies_with_all_errors/main.pl b/tests/integration/manifest_multiple_dependencies_with_all_errors/main.pl index 344f5bc..91e6820 100644 --- a/tests/integration/manifest_multiple_dependencies_with_all_errors/main.pl +++ b/tests/integration/manifest_multiple_dependencies_with_all_errors/main.pl @@ -7,16 +7,12 @@ main :- run_tests. - + test("the package report is valid", ( pkg_install(X), list_to_ord_set(X, X_Set), list_to_ord_set([ - validate_dependency(dependency("test", git("https://github.com/constraintAutomaton/test-prolog-package-manager_.git")))-success, - validate_dependency(dependency("test_branch", git("https://github.com/constraintAutomaton/test-prolog-package-manager.git", branch("branch_"))))-success, - validate_dependency(dependency("test_tag", git("https://github.com/constraintAutomaton/test-prolog-package-manager.git", tag("tag_"))))-success, - validate_dependency(dependency("test_hash", git("https://github.com/constraintAutomaton/test-prolog-package-manager.git", hash("abc"))))-success, - validate_dependency(dependency("test_local", path("./local_package_")))-success, + validate_manifest-success, install_dependency(dependency("test", git("https://github.com/constraintAutomaton/test-prolog-package-manager_.git")))-error(_), install_dependency(dependency("test_branch", git("https://github.com/constraintAutomaton/test-prolog-package-manager.git", branch("branch_"))))-error(_), @@ -26,4 +22,4 @@ ], Expected), test_unify(X_Set, Expected) ) -). \ No newline at end of file +). diff --git a/tests/integration/manifest_multiple_dependencies_with_all_errors/scryer-manifest.pl b/tests/integration/manifest_multiple_dependencies_with_all_errors/scryer-manifest.pl index 230567d..b1c73b0 100644 --- a/tests/integration/manifest_multiple_dependencies_with_all_errors/scryer-manifest.pl +++ b/tests/integration/manifest_multiple_dependencies_with_all_errors/scryer-manifest.pl @@ -1,6 +1,6 @@ name("name_of_the_package"). main_file("main.pl"). - +license(name("UNLICENSE")). dependencies([ dependency("test", git("https://github.com/constraintAutomaton/test-prolog-package-manager_.git")), dependency("test_branch", git("https://github.com/constraintAutomaton/test-prolog-package-manager.git", branch("branch_"))), diff --git a/tests/integration/manifest_multiple_dependencies_with_one_error/main.pl b/tests/integration/manifest_multiple_dependencies_with_one_error/main.pl index 1642710..453de27 100644 --- a/tests/integration/manifest_multiple_dependencies_with_one_error/main.pl +++ b/tests/integration/manifest_multiple_dependencies_with_one_error/main.pl @@ -7,17 +7,12 @@ main :- run_tests. - + test("the package report is valid", ( pkg_install(X), list_to_ord_set(X, X_Set), list_to_ord_set([ - validate_dependency(dependency("test", git("https://github.com/constraintAutomaton/test-prolog-package-manager.git")))-success, - validate_dependency(dependency("test_branch", git("https://github.com/constraintAutomaton/test-prolog-package-manager.git", branch("branch"))))-success, - validate_dependency(dependency("test_tag", git("https://github.com/constraintAutomaton/test-prolog-package-manager.git", tag("tag"))))-success, - validate_dependency(dependency("test_hash", git("https://github.com/constraintAutomaton/test-prolog-package-manager.git", hash("d19fefc1d7907f6675e181601bb9b8b94561b441"))))-success, - validate_dependency(dependency("test_local", path("./local_package")))-success, - validate_dependency(dependency("error", path("./bar")))-success, + validate_manifest-success, install_dependency(dependency("test", git("https://github.com/constraintAutomaton/test-prolog-package-manager.git")))-success, install_dependency(dependency("test_branch", git("https://github.com/constraintAutomaton/test-prolog-package-manager.git", branch("branch"))))-success, @@ -28,4 +23,4 @@ ], Expected), test_unify(X_Set, Expected) ) -). \ No newline at end of file +). diff --git a/tests/integration/manifest_multiple_dependencies_with_one_error/scryer-manifest.pl b/tests/integration/manifest_multiple_dependencies_with_one_error/scryer-manifest.pl index 42fb025..b79dfe8 100644 --- a/tests/integration/manifest_multiple_dependencies_with_one_error/scryer-manifest.pl +++ b/tests/integration/manifest_multiple_dependencies_with_one_error/scryer-manifest.pl @@ -1,6 +1,6 @@ name("name_of_the_package"). main_file("main.pl"). - +license(name("UNLICENSE")). dependencies([ dependency("test", git("https://github.com/constraintAutomaton/test-prolog-package-manager.git")), dependency("test_branch", git("https://github.com/constraintAutomaton/test-prolog-package-manager.git", branch("branch"))), diff --git a/tests/integration/manifest_with_git_branch_dependency/main.pl b/tests/integration/manifest_with_git_branch_dependency/main.pl index ac423b4..48a3e6d 100644 --- a/tests/integration/manifest_with_git_branch_dependency/main.pl +++ b/tests/integration/manifest_with_git_branch_dependency/main.pl @@ -6,13 +6,13 @@ main :- run_tests. - + test("the package report is valid", ( pkg_install(X), Expected = [ - validate_dependency(dependency("test", git("https://github.com/constraintAutomaton/test-prolog-package-manager.git", branch("branch"))))-success, + validate_manifest-success, install_dependency(dependency("test", git("https://github.com/constraintAutomaton/test-prolog-package-manager.git", branch("branch"))))-success ], test_eq(X, Expected) ) -). \ No newline at end of file +). diff --git a/tests/integration/manifest_with_git_branch_dependency/scryer-manifest.pl b/tests/integration/manifest_with_git_branch_dependency/scryer-manifest.pl index 1eb7d8b..5d978b8 100644 --- a/tests/integration/manifest_with_git_branch_dependency/scryer-manifest.pl +++ b/tests/integration/manifest_with_git_branch_dependency/scryer-manifest.pl @@ -1,5 +1,6 @@ name("manifest_with_no_dependencies"). main_file("main.pl"). +license(name("UNLICENSE")). dependencies([ dependency("test", git("https://github.com/constraintAutomaton/test-prolog-package-manager.git", branch("branch"))) ]). diff --git a/tests/integration/manifest_with_git_branch_dependency_already_installed/main.pl b/tests/integration/manifest_with_git_branch_dependency_already_installed/main.pl index cac8ad6..aae3a3a 100644 --- a/tests/integration/manifest_with_git_branch_dependency_already_installed/main.pl +++ b/tests/integration/manifest_with_git_branch_dependency_already_installed/main.pl @@ -7,13 +7,13 @@ main :- pkg_install(_), run_tests. - + test("the package report is valid", ( pkg_install(X), Expected = [ - validate_dependency(dependency("test", git("https://github.com/constraintAutomaton/test-prolog-package-manager.git", branch("branch"))))-success, + validate_manifest-success, do_nothing(dependency("test", git("https://github.com/constraintAutomaton/test-prolog-package-manager.git", branch("branch"))))-success ], test_eq(X, Expected) ) -). \ No newline at end of file +). diff --git a/tests/integration/manifest_with_git_branch_dependency_already_installed/scryer-manifest.pl b/tests/integration/manifest_with_git_branch_dependency_already_installed/scryer-manifest.pl index 1eb7d8b..5d978b8 100644 --- a/tests/integration/manifest_with_git_branch_dependency_already_installed/scryer-manifest.pl +++ b/tests/integration/manifest_with_git_branch_dependency_already_installed/scryer-manifest.pl @@ -1,5 +1,6 @@ name("manifest_with_no_dependencies"). main_file("main.pl"). +license(name("UNLICENSE")). dependencies([ dependency("test", git("https://github.com/constraintAutomaton/test-prolog-package-manager.git", branch("branch"))) ]). diff --git a/tests/integration/manifest_with_git_dependency/main.pl b/tests/integration/manifest_with_git_dependency/main.pl index 72b014b..cd75a73 100644 --- a/tests/integration/manifest_with_git_dependency/main.pl +++ b/tests/integration/manifest_with_git_dependency/main.pl @@ -10,9 +10,9 @@ test("the package report is valid", ( pkg_install(X), Expected = [ - validate_dependency(dependency("test", git("https://github.com/constraintAutomaton/test-prolog-package-manager.git")))-success, + validate_manifest-success, install_dependency(dependency("test", git("https://github.com/constraintAutomaton/test-prolog-package-manager.git")))-success ], test_eq(X, Expected) ) -). \ No newline at end of file +). diff --git a/tests/integration/manifest_with_git_dependency/scryer-manifest.pl b/tests/integration/manifest_with_git_dependency/scryer-manifest.pl index ef35326..4487157 100644 --- a/tests/integration/manifest_with_git_dependency/scryer-manifest.pl +++ b/tests/integration/manifest_with_git_dependency/scryer-manifest.pl @@ -1,5 +1,6 @@ name("manifest_with_no_dependencies"). main_file("main.pl"). +license(name("UNLICENSE")). dependencies([ dependency("test", git("https://github.com/constraintAutomaton/test-prolog-package-manager.git")) ]). diff --git a/tests/integration/manifest_with_git_dependency_already_installed/main.pl b/tests/integration/manifest_with_git_dependency_already_installed/main.pl index be84d20..5b74385 100644 --- a/tests/integration/manifest_with_git_dependency_already_installed/main.pl +++ b/tests/integration/manifest_with_git_dependency_already_installed/main.pl @@ -11,9 +11,9 @@ test("the package report is valid", ( pkg_install(X), Expected = [ - validate_dependency(dependency("test", git("https://github.com/constraintAutomaton/test-prolog-package-manager.git")))-success, + validate_manifest-success, do_nothing(dependency("test", git("https://github.com/constraintAutomaton/test-prolog-package-manager.git")))-success ], test_eq(X, Expected) ) -). \ No newline at end of file +). diff --git a/tests/integration/manifest_with_git_dependency_already_installed/scryer-manifest.pl b/tests/integration/manifest_with_git_dependency_already_installed/scryer-manifest.pl index ef35326..4487157 100644 --- a/tests/integration/manifest_with_git_dependency_already_installed/scryer-manifest.pl +++ b/tests/integration/manifest_with_git_dependency_already_installed/scryer-manifest.pl @@ -1,5 +1,6 @@ name("manifest_with_no_dependencies"). main_file("main.pl"). +license(name("UNLICENSE")). dependencies([ dependency("test", git("https://github.com/constraintAutomaton/test-prolog-package-manager.git")) ]). diff --git a/tests/integration/manifest_with_git_hash_dependency/license b/tests/integration/manifest_with_git_hash_dependency/license new file mode 100644 index 0000000..579755f --- /dev/null +++ b/tests/integration/manifest_with_git_hash_dependency/license @@ -0,0 +1 @@ +this is a license diff --git a/tests/integration/manifest_with_git_hash_dependency/main.pl b/tests/integration/manifest_with_git_hash_dependency/main.pl index cd95112..29dfe35 100644 --- a/tests/integration/manifest_with_git_hash_dependency/main.pl +++ b/tests/integration/manifest_with_git_hash_dependency/main.pl @@ -10,9 +10,9 @@ test("the package report is valid", ( pkg_install(X), Expected = [ - validate_dependency(dependency("test", git("https://github.com/constraintAutomaton/test-prolog-package-manager.git", hash("d19fefc1d7907f6675e181601bb9b8b94561b441"))))-success, + validate_manifest-success, install_dependency(dependency("test", git("https://github.com/constraintAutomaton/test-prolog-package-manager.git", hash("d19fefc1d7907f6675e181601bb9b8b94561b441"))))-success ], test_eq(X, Expected) ) -). \ No newline at end of file +). diff --git a/tests/integration/manifest_with_git_hash_dependency/scryer-manifest.pl b/tests/integration/manifest_with_git_hash_dependency/scryer-manifest.pl index c6cb118..ffbaea7 100644 --- a/tests/integration/manifest_with_git_hash_dependency/scryer-manifest.pl +++ b/tests/integration/manifest_with_git_hash_dependency/scryer-manifest.pl @@ -1,5 +1,6 @@ name("manifest_with_no_dependencies"). main_file("main.pl"). +license(name("UNLICENSE"), path("./license")). dependencies([ dependency("test", git("https://github.com/constraintAutomaton/test-prolog-package-manager.git", hash("d19fefc1d7907f6675e181601bb9b8b94561b441"))) ]). diff --git a/tests/integration/manifest_with_git_hash_dependency_already_installed/main.pl b/tests/integration/manifest_with_git_hash_dependency_already_installed/main.pl index 8a634a8..5b96628 100644 --- a/tests/integration/manifest_with_git_hash_dependency_already_installed/main.pl +++ b/tests/integration/manifest_with_git_hash_dependency_already_installed/main.pl @@ -11,9 +11,9 @@ test("the package report is valid", ( pkg_install(X), Expected = [ - validate_dependency(dependency("test", git("https://github.com/constraintAutomaton/test-prolog-package-manager.git", hash("d19fefc1d7907f6675e181601bb9b8b94561b441"))))-success, + validate_manifest-success, do_nothing(dependency("test", git("https://github.com/constraintAutomaton/test-prolog-package-manager.git", hash("d19fefc1d7907f6675e181601bb9b8b94561b441"))))-success ], test_eq(X, Expected) ) -). \ No newline at end of file +). diff --git a/tests/integration/manifest_with_git_hash_dependency_already_installed/scryer-manifest.pl b/tests/integration/manifest_with_git_hash_dependency_already_installed/scryer-manifest.pl index c6cb118..6276cb3 100644 --- a/tests/integration/manifest_with_git_hash_dependency_already_installed/scryer-manifest.pl +++ b/tests/integration/manifest_with_git_hash_dependency_already_installed/scryer-manifest.pl @@ -1,5 +1,6 @@ name("manifest_with_no_dependencies"). main_file("main.pl"). +license(name("UNLICENSE")). dependencies([ dependency("test", git("https://github.com/constraintAutomaton/test-prolog-package-manager.git", hash("d19fefc1d7907f6675e181601bb9b8b94561b441"))) ]). diff --git a/tests/integration/manifest_with_git_tag_dependency/main.pl b/tests/integration/manifest_with_git_tag_dependency/main.pl index b132d96..462ac45 100644 --- a/tests/integration/manifest_with_git_tag_dependency/main.pl +++ b/tests/integration/manifest_with_git_tag_dependency/main.pl @@ -10,9 +10,9 @@ test("the package report is valid", ( pkg_install(X), Expected = [ - validate_dependency(dependency("test", git("https://github.com/constraintAutomaton/test-prolog-package-manager.git", tag("tag"))))-success, + validate_manifest-success, install_dependency(dependency("test", git("https://github.com/constraintAutomaton/test-prolog-package-manager.git", tag("tag"))))-success ], test_eq(X, Expected) ) -). \ No newline at end of file +). diff --git a/tests/integration/manifest_with_git_tag_dependency/scryer-manifest.pl b/tests/integration/manifest_with_git_tag_dependency/scryer-manifest.pl index 45da335..54b0b5a 100644 --- a/tests/integration/manifest_with_git_tag_dependency/scryer-manifest.pl +++ b/tests/integration/manifest_with_git_tag_dependency/scryer-manifest.pl @@ -1,5 +1,6 @@ name("manifest_with_no_dependencies"). main_file("main.pl"). +license(name("UNLICENSE")). dependencies([ dependency("test", git("https://github.com/constraintAutomaton/test-prolog-package-manager.git", tag("tag"))) ]). diff --git a/tests/integration/manifest_with_git_tag_dependency_already_installed/main.pl b/tests/integration/manifest_with_git_tag_dependency_already_installed/main.pl index 059aab2..9c192fa 100644 --- a/tests/integration/manifest_with_git_tag_dependency_already_installed/main.pl +++ b/tests/integration/manifest_with_git_tag_dependency_already_installed/main.pl @@ -11,9 +11,9 @@ test("the package report is valid", ( pkg_install(X), Expected = [ - validate_dependency(dependency("test", git("https://github.com/constraintAutomaton/test-prolog-package-manager.git", tag("tag"))))-success, + validate_manifest-success, do_nothing(dependency("test", git("https://github.com/constraintAutomaton/test-prolog-package-manager.git", tag("tag"))))-success ], test_eq(X, Expected) ) -). \ No newline at end of file +). diff --git a/tests/integration/manifest_with_git_tag_dependency_already_installed/scryer-manifest.pl b/tests/integration/manifest_with_git_tag_dependency_already_installed/scryer-manifest.pl index 45da335..54b0b5a 100644 --- a/tests/integration/manifest_with_git_tag_dependency_already_installed/scryer-manifest.pl +++ b/tests/integration/manifest_with_git_tag_dependency_already_installed/scryer-manifest.pl @@ -1,5 +1,6 @@ name("manifest_with_no_dependencies"). main_file("main.pl"). +license(name("UNLICENSE")). dependencies([ dependency("test", git("https://github.com/constraintAutomaton/test-prolog-package-manager.git", tag("tag"))) ]). diff --git a/tests/integration/manifest_with_no_dependencies/main.pl b/tests/integration/manifest_with_no_dependencies/main.pl index 862c0a6..65718f6 100644 --- a/tests/integration/manifest_with_no_dependencies/main.pl +++ b/tests/integration/manifest_with_no_dependencies/main.pl @@ -5,4 +5,4 @@ main :- run_tests. -test("test if no dependencies are installed", (pkg_install(X), test_eq(X, []))). +test("test if no dependencies are installed", (pkg_install(X), test_eq(X, [validate_manifest-success]))). diff --git a/tests/integration/manifest_with_no_dependencies/scryer-manifest.pl b/tests/integration/manifest_with_no_dependencies/scryer-manifest.pl index 81f6cb4..4e41805 100644 --- a/tests/integration/manifest_with_no_dependencies/scryer-manifest.pl +++ b/tests/integration/manifest_with_no_dependencies/scryer-manifest.pl @@ -1,3 +1,4 @@ name("manifest_with_no_dependencies"). main_file("main.pl"). +license(name("UNLICENSE")). dependencies([]). diff --git a/tests/integration/manifest_with_no_dependency_predicate/main.pl b/tests/integration/manifest_with_no_dependency_predicate/main.pl index 862c0a6..65718f6 100644 --- a/tests/integration/manifest_with_no_dependency_predicate/main.pl +++ b/tests/integration/manifest_with_no_dependency_predicate/main.pl @@ -5,4 +5,4 @@ main :- run_tests. -test("test if no dependencies are installed", (pkg_install(X), test_eq(X, []))). +test("test if no dependencies are installed", (pkg_install(X), test_eq(X, [validate_manifest-success]))). diff --git a/tests/integration/manifest_with_no_dependency_predicate/scryer-manifest.pl b/tests/integration/manifest_with_no_dependency_predicate/scryer-manifest.pl index c70b442..d93b267 100644 --- a/tests/integration/manifest_with_no_dependency_predicate/scryer-manifest.pl +++ b/tests/integration/manifest_with_no_dependency_predicate/scryer-manifest.pl @@ -1,2 +1,3 @@ name("manifest_with_no_dependency_predicate"). +license(name("UNLICENSE")). main_file("main.pl"). diff --git a/tests/integration/manifest_with_path_dependency/main.pl b/tests/integration/manifest_with_path_dependency/main.pl index ac61efc..d110911 100644 --- a/tests/integration/manifest_with_path_dependency/main.pl +++ b/tests/integration/manifest_with_path_dependency/main.pl @@ -10,9 +10,9 @@ test("the package report is valid", ( pkg_install(X), Expected = [ - validate_dependency(dependency("test", path("./local_package")))-success, + validate_manifest-success, install_dependency(dependency("test", path("./local_package")))-success ], test_eq(X, Expected) ) -). \ No newline at end of file +). diff --git a/tests/integration/manifest_with_path_dependency/scryer-manifest.pl b/tests/integration/manifest_with_path_dependency/scryer-manifest.pl index 011599a..9624d83 100644 --- a/tests/integration/manifest_with_path_dependency/scryer-manifest.pl +++ b/tests/integration/manifest_with_path_dependency/scryer-manifest.pl @@ -1,5 +1,6 @@ name("manifest_with_no_dependencies"). main_file("main.pl"). +license(name("UNLICENSE")). dependencies([ dependency("test", path("./local_package")) ]). diff --git a/tests/integration/manifest_with_path_dependency_already_installed/main.pl b/tests/integration/manifest_with_path_dependency_already_installed/main.pl index 236b837..a95db4e 100644 --- a/tests/integration/manifest_with_path_dependency_already_installed/main.pl +++ b/tests/integration/manifest_with_path_dependency_already_installed/main.pl @@ -11,9 +11,9 @@ test("the package report is valid", ( pkg_install(X), Expected = [ - validate_dependency(dependency("test", path("./local_package")))-success, + validate_manifest-success, do_nothing(dependency("test", path("./local_package")))-success ], test_eq(X, Expected) ) -). \ No newline at end of file +). diff --git a/tests/integration/manifest_with_path_dependency_already_installed/scryer-manifest.pl b/tests/integration/manifest_with_path_dependency_already_installed/scryer-manifest.pl index 011599a..9624d83 100644 --- a/tests/integration/manifest_with_path_dependency_already_installed/scryer-manifest.pl +++ b/tests/integration/manifest_with_path_dependency_already_installed/scryer-manifest.pl @@ -1,5 +1,6 @@ name("manifest_with_no_dependencies"). main_file("main.pl"). +license(name("UNLICENSE")). dependencies([ dependency("test", path("./local_package")) ]). diff --git a/tests/integration/one_invalid_dependency_stop_installation/main.pl b/tests/integration/one_invalid_dependency_stop_installation/main.pl index faa5331..cd386c0 100644 --- a/tests/integration/one_invalid_dependency_stop_installation/main.pl +++ b/tests/integration/one_invalid_dependency_stop_installation/main.pl @@ -8,7 +8,7 @@ main :- run_tests. - + test("the package report is valid", ( pkg_install(X), list_to_ord_set([ @@ -21,4 +21,4 @@ list_to_ord_set(X, X_Set), test_unify(X_Set, Expected) ) -). \ No newline at end of file +). diff --git a/tests/integration/one_invalid_dependency_stop_installation/scryer-manifest.pl b/tests/integration/one_invalid_dependency_stop_installation/scryer-manifest.pl index cc1ea79..fc1a4bb 100644 --- a/tests/integration/one_invalid_dependency_stop_installation/scryer-manifest.pl +++ b/tests/integration/one_invalid_dependency_stop_installation/scryer-manifest.pl @@ -1,10 +1,10 @@ name("name_of_the_package"). main_file("main.pl"). - +license(name("UNLICENSE")). dependencies([ dependency("test", git("https://github.com/constraintAutomaton/test-prolog-package-manager.git|abc")), dependency("test_branch", git("https://github.com/constraintAutomaton/test-prolog-package-manager.git", branch("branch"))), dependency("test_tag", git("https://github.com/constraintAutomaton/test-prolog-package-manager.git", tag("tag"))), dependency("test_hash", git("https://github.com/constraintAutomaton/test-prolog-package-manager.git", hash("d19fefc1d7907f6675e181601bb9b8b94561b441"))), dependency("test_local", path("./local_package")) -]). \ No newline at end of file +]). diff --git a/tests/integration/use_module/scryer-manifest.pl b/tests/integration/use_module/scryer-manifest.pl index 5e54d4f..8e33756 100644 --- a/tests/integration/use_module/scryer-manifest.pl +++ b/tests/integration/use_module/scryer-manifest.pl @@ -1,5 +1,6 @@ name("name_of_the_package"). main_file("main.pl"). +license(name("UNLICENSE")). dependencies([ dependency("test", git("https://github.com/constraintAutomaton/test-prolog-package-manager.git")), diff --git a/tests/snapshot/cases/subdirectory_imports.in/scryer-manifest.pl b/tests/snapshot/cases/subdirectory_imports.in/scryer-manifest.pl index 8c51ac8..d1c7fdc 100644 --- a/tests/snapshot/cases/subdirectory_imports.in/scryer-manifest.pl +++ b/tests/snapshot/cases/subdirectory_imports.in/scryer-manifest.pl @@ -1,5 +1,5 @@ name("bakage-repro"). - +license(name("UNLICENSE")). dependencies([ dependency("testing", git("https://github.com/bakaq/testing.pl.git")) ]).