From d465772c317bdfe5546b829e7542cc4c5711c708 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Mon, 11 Nov 2013 14:43:11 -0700 Subject: [PATCH] raco pkg update: extra tests --- .../tests/pkg/test-pkgs/pkg-v-three/info.rkt | 5 +++ .../tests/pkg/test-pkgs/pkg-w-three/info.rkt | 5 +++ .../tests/pkg/test-pkgs/pkg-w-two/info.rkt | 5 +++ .../racket-test/tests/pkg/tests-versions.rkt | 34 ++++++++++++++++++- 4 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 pkgs/racket-pkgs/racket-test/tests/pkg/test-pkgs/pkg-v-three/info.rkt create mode 100644 pkgs/racket-pkgs/racket-test/tests/pkg/test-pkgs/pkg-w-three/info.rkt create mode 100644 pkgs/racket-pkgs/racket-test/tests/pkg/test-pkgs/pkg-w-two/info.rkt diff --git a/pkgs/racket-pkgs/racket-test/tests/pkg/test-pkgs/pkg-v-three/info.rkt b/pkgs/racket-pkgs/racket-test/tests/pkg/test-pkgs/pkg-v-three/info.rkt new file mode 100644 index 0000000000..fd7f8f62b9 --- /dev/null +++ b/pkgs/racket-pkgs/racket-test/tests/pkg/test-pkgs/pkg-v-three/info.rkt @@ -0,0 +1,5 @@ +#lang info + +(define collection 'multi) + +(define version "2.3") diff --git a/pkgs/racket-pkgs/racket-test/tests/pkg/test-pkgs/pkg-w-three/info.rkt b/pkgs/racket-pkgs/racket-test/tests/pkg/test-pkgs/pkg-w-three/info.rkt new file mode 100644 index 0000000000..76b98901de --- /dev/null +++ b/pkgs/racket-pkgs/racket-test/tests/pkg/test-pkgs/pkg-w-three/info.rkt @@ -0,0 +1,5 @@ +#lang info + +(define collection 'multi) + +(define deps '(("pkg-v" #:version "2.3"))) diff --git a/pkgs/racket-pkgs/racket-test/tests/pkg/test-pkgs/pkg-w-two/info.rkt b/pkgs/racket-pkgs/racket-test/tests/pkg/test-pkgs/pkg-w-two/info.rkt new file mode 100644 index 0000000000..385e303d2e --- /dev/null +++ b/pkgs/racket-pkgs/racket-test/tests/pkg/test-pkgs/pkg-w-two/info.rkt @@ -0,0 +1,5 @@ +#lang info + +(define collection 'multi) + +(define deps '(("pkg-v" #:version "2.2"))) diff --git a/pkgs/racket-pkgs/racket-test/tests/pkg/tests-versions.rkt b/pkgs/racket-pkgs/racket-test/tests/pkg/tests-versions.rkt index 5b0e29f655..54c4357800 100644 --- a/pkgs/racket-pkgs/racket-test/tests/pkg/tests-versions.rkt +++ b/pkgs/racket-pkgs/racket-test/tests/pkg/tests-versions.rkt @@ -21,7 +21,10 @@ "create packages" $ "raco pkg create --format zip test-pkgs/pkg-v-one" $ "raco pkg create --format zip test-pkgs/pkg-v-two" - $ "raco pkg create --format zip test-pkgs/pkg-w-one") + $ "raco pkg create --format zip test-pkgs/pkg-w-one" + $ "raco pkg create --format zip test-pkgs/pkg-v-three" + $ "raco pkg create --format zip test-pkgs/pkg-w-two" + $ "raco pkg create --format zip test-pkgs/pkg-w-three") (hash-set! *index-ht-1* "pkg-v" (hasheq 'checksum @@ -61,5 +64,34 @@ (shelly-begin "auto-update now succeeds (installs and version matches)" $ "raco pkg install --deps search-auto pkg-w")) + (hash-set! *index-ht-1* "pkg-v" + (hasheq 'checksum + (file->string "test-pkgs/pkg-v-three.zip.CHECKSUM") + 'source + "http://localhost:9999/pkg-v-three.zip")) + (hash-set! *index-ht-1* "pkg-w" + (hasheq 'checksum + (file->string "test-pkgs/pkg-w-two.zip.CHECKSUM") + 'source + "http://localhost:9999/pkg-w-two.zip")) + + (shelly-case + "update again" + (shelly-begin "transitive update succeeds" + $ "raco pkg update --auto pkg-w" + =stdout> #rx"automatically updated.* pkg-v")) + + (hash-set! *index-ht-1* "pkg-w" + (hasheq 'checksum + (file->string "test-pkgs/pkg-w-three.zip.CHECKSUM") + 'source + "http://localhost:9999/pkg-w-three.zip")) + + (shelly-case + "update again" + (shelly-begin "update without needed pkg-v update" + $ "raco pkg update --auto pkg-w" + =stdout> #rx"esolving \"pkg-v\"(?!.*pkg-v)")) + (initialize-catalogs)))