From 654fcf9971bb01389d577be07c6ec0f68940c743 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 31 May 2023 23:50:06 +0200 Subject: tests: Use quasiquoted 'match' patterns for package sexps. Turns out it's easier to read. * tests/cpan.scm ("cpan->guix-package"): Use a quasiquoted pattern. * tests/elpa.scm (eval-test-with-elpa): Likewise. * tests/gem.scm ("gem->guix-package") ("gem->guix-package with a specific version") ("gem-recursive-import") ("gem-recursive-import with a specific version"): Likewise. * tests/hexpm.scm ("hexpm-recursive-import"): Likewise. * tests/opam.scm ("opam->guix-package"): Likewise. * tests/pypi.scm ("pypi->guix-package, no wheel") ("pypi->guix-package, wheels") ("pypi->guix-package, no usable requirement file.") ("pypi->guix-package, package name contains \"-\" followed by digits"): Likewise. * tests/texlive.scm ("texlive->guix-package"): Likewise. --- tests/gem.scm | 184 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 92 insertions(+), 92 deletions(-) (limited to 'tests/gem.scm') diff --git a/tests/gem.scm b/tests/gem.scm index a2b5e39077..7e2436e3fb 100644 --- a/tests/gem.scm +++ b/tests/gem.scm @@ -105,21 +105,21 @@ (string-length test-foo-json))) (_ (error "Unexpected URL: " url))))) (match (gem->guix-package "foo") - (('package - ('name "ruby-foo") - ('version "1.0.0") - ('source ('origin - ('method 'url-fetch) - ('uri ('rubygems-uri "foo" 'version)) - ('sha256 - ('base32 + (`(package + (name "ruby-foo") + (version "1.0.0") + (source (origin + (method url-fetch) + (uri (rubygems-uri "foo" version)) + (sha256 + (base32 "1a270mlajhrmpqbhxcqjqypnvgrq4pgixpv3w9gwp1wrrapnwrzk")))) - ('build-system 'ruby-build-system) - ('propagated-inputs ('list 'bundler 'ruby-bar)) - ('synopsis "A cool gem") - ('description "This package provides a cool gem") - ('home-page "https://example.com") - ('license ('list 'license:expat 'license:asl2.0))) + (build-system ruby-build-system) + (propagated-inputs (list bundler ruby-bar)) + (synopsis "A cool gem") + (description "This package provides a cool gem") + (home-page "https://example.com") + (license (list license:expat license:asl2.0))) #t) (x (pk 'fail x #f))))) @@ -134,21 +134,21 @@ (string-length test-foo-v2-json))) (_ (error "Unexpected URL: " url))))) (match (gem->guix-package "foo" #:version "2.0.0") - (('package - ('name "ruby-foo") - ('version "2.0.0") - ('source ('origin - ('method 'url-fetch) - ('uri ('rubygems-uri "foo" 'version)) - ('sha256 - ('base32 + (`(package + (name "ruby-foo") + (version "2.0.0") + (source (origin + (method url-fetch) + (uri (rubygems-uri "foo" version)) + (sha256 + (base32 "1a270mlajhrmpqbhxcqjqypnvgrq4pgixpv3w9gwp1wrrapnwrzk")))) - ('build-system 'ruby-build-system) - ('propagated-inputs ('list 'bundler 'ruby-bar)) - ('synopsis "A cool gem") - ('description "This package provides a cool gem") - ('home-page "https://example.com") - ('license ('list 'license:expat 'license:asl2.0))) + (build-system ruby-build-system) + (propagated-inputs (list bundler ruby-bar)) + (synopsis "A cool gem") + (description "This package provides a cool gem") + (home-page "https://example.com") + (license (list license:expat license:asl2.0))) #t) (x (pk 'fail x #f))))) @@ -169,38 +169,38 @@ (string-length test-bundler-json))) (_ (error "Unexpected URL: " url))))) (match (gem-recursive-import "foo") - ((('package - ('name "ruby-bar") - ('version "1.0.0") - ('source - ('origin - ('method 'url-fetch) - ('uri ('rubygems-uri "bar" 'version)) - ('sha256 - ('base32 - "1a270mlajhrmpqbhxcqjqypnvgrq4pgixpv3w9gwp1wrrapnwrzk")))) - ('build-system 'ruby-build-system) - ('propagated-inputs ('list 'bundler)) - ('synopsis "Another cool gem") - ('description "Another cool gem") - ('home-page "https://example.com") - ('license #f)) ;no licensing info - ('package - ('name "ruby-foo") - ('version "1.0.0") - ('source - ('origin - ('method 'url-fetch) - ('uri ('rubygems-uri "foo" 'version)) - ('sha256 - ('base32 - "1a270mlajhrmpqbhxcqjqypnvgrq4pgixpv3w9gwp1wrrapnwrzk")))) - ('build-system 'ruby-build-system) - ('propagated-inputs ('list 'bundler 'ruby-bar)) - ('synopsis "A cool gem") - ('description "This package provides a cool gem") - ('home-page "https://example.com") - ('license ('list 'license:expat 'license:asl2.0)))) + (`((package + (name "ruby-bar") + (version "1.0.0") + (source + (origin + (method url-fetch) + (uri (rubygems-uri "bar" version)) + (sha256 + (base32 + "1a270mlajhrmpqbhxcqjqypnvgrq4pgixpv3w9gwp1wrrapnwrzk")))) + (build-system ruby-build-system) + (propagated-inputs (list bundler)) + (synopsis "Another cool gem") + (description "Another cool gem") + (home-page "https://example.com") + (license #f)) ;no licensing info + (package + (name "ruby-foo") + (version "1.0.0") + (source + (origin + (method url-fetch) + (uri (rubygems-uri "foo" version)) + (sha256 + (base32 + "1a270mlajhrmpqbhxcqjqypnvgrq4pgixpv3w9gwp1wrrapnwrzk")))) + (build-system ruby-build-system) + (propagated-inputs (list bundler ruby-bar)) + (synopsis "A cool gem") + (description "This package provides a cool gem") + (home-page "https://example.com") + (license (list license:expat license:asl2.0)))) #t) (x (pk 'fail x #f))))) @@ -221,38 +221,38 @@ (string-length test-bundler-json))) (_ (error "Unexpected URL: " url))))) (match (gem-recursive-import "foo" "2.0.0") - ((('package - ('name "ruby-bar") - ('version "1.0.0") - ('source - ('origin - ('method 'url-fetch) - ('uri ('rubygems-uri "bar" 'version)) - ('sha256 - ('base32 - "1a270mlajhrmpqbhxcqjqypnvgrq4pgixpv3w9gwp1wrrapnwrzk")))) - ('build-system 'ruby-build-system) - ('propagated-inputs ('list 'bundler)) - ('synopsis "Another cool gem") - ('description "Another cool gem") - ('home-page "https://example.com") - ('license #f)) ;no licensing info - ('package - ('name "ruby-foo") - ('version "2.0.0") - ('source - ('origin - ('method 'url-fetch) - ('uri ('rubygems-uri "foo" 'version)) - ('sha256 - ('base32 - "1a270mlajhrmpqbhxcqjqypnvgrq4pgixpv3w9gwp1wrrapnwrzk")))) - ('build-system 'ruby-build-system) - ('propagated-inputs ('list 'bundler 'ruby-bar)) - ('synopsis "A cool gem") - ('description "This package provides a cool gem") - ('home-page "https://example.com") - ('license ('list 'license:expat 'license:asl2.0)))) + (`((package + (name "ruby-bar") + (version "1.0.0") + (source + (origin + (method url-fetch) + (uri (rubygems-uri "bar" version)) + (sha256 + (base32 + "1a270mlajhrmpqbhxcqjqypnvgrq4pgixpv3w9gwp1wrrapnwrzk")))) + (build-system ruby-build-system) + (propagated-inputs (list bundler)) + (synopsis "Another cool gem") + (description "Another cool gem") + (home-page "https://example.com") + (license #f)) ;no licensing info + (package + (name "ruby-foo") + (version "2.0.0") + (source + (origin + (method url-fetch) + (uri (rubygems-uri "foo" version)) + (sha256 + (base32 + "1a270mlajhrmpqbhxcqjqypnvgrq4pgixpv3w9gwp1wrrapnwrzk")))) + (build-system ruby-build-system) + (propagated-inputs (list bundler ruby-bar)) + (synopsis "A cool gem") + (description "This package provides a cool gem") + (home-page "https://example.com") + (license (list license:expat license:asl2.0)))) #t) (x (pk 'fail x #f))))) -- cgit v1.2.3