-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
360 additions
and
190 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
Copyright 2018 PureScript | ||
|
||
Redistribution and use in source and binary forms, with or without modification, | ||
are permitted provided that the following conditions are met: | ||
|
||
1. Redistributions of source code must retain the above copyright notice, this | ||
list of conditions and the following disclaimer. | ||
|
||
2. Redistributions in binary form must reproduce the above copyright notice, | ||
this list of conditions and the following disclaimer in the documentation and/or | ||
other materials provided with the distribution. | ||
|
||
3. Neither the name of the copyright holder nor the names of its contributors | ||
may be used to endorse or promote products derived from this software without | ||
specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR | ||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
22 changes: 22 additions & 0 deletions
22
app/fixtures/github-packages/type-equality-4.0.1/bower.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"name": "purescript-type-equality", | ||
"homepage": "https://github.com/purescript/purescript-type-equality", | ||
"license": "BSD-3-Clause", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/purescript/purescript-type-equality.git" | ||
}, | ||
"ignore": [ | ||
"**/.*", | ||
"bower_components", | ||
"node_modules", | ||
"output", | ||
"test", | ||
"bower.json", | ||
"package.json" | ||
], | ||
"devDependencies": { | ||
"purescript-console": "^6.0.0", | ||
"purescript-newtype": "^5.0.0" | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
app/fixtures/github-packages/type-equality-4.0.1/src/Type/Equality.purs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
module Type.Equality | ||
( class TypeEquals | ||
, proof | ||
, to | ||
, from | ||
) where | ||
|
||
import Prim.Coerce (class Coercible) | ||
|
||
-- | This type class asserts that types `a` and `b` | ||
-- | are equal. | ||
-- | | ||
-- | The functional dependencies and the single | ||
-- | instance below will force the two type arguments | ||
-- | to unify when either one is known. | ||
-- | | ||
-- | Note: any instance will necessarily overlap with | ||
-- | `refl` below, so instances of this class should | ||
-- | not be defined in libraries. | ||
class TypeEquals :: forall k. k -> k -> Constraint | ||
class Coercible a b <= TypeEquals a b | a -> b, b -> a where | ||
proof :: forall p. p a -> p b | ||
|
||
instance refl :: TypeEquals a a where | ||
proof a = a | ||
|
||
newtype To a b = To (a -> b) | ||
|
||
to :: forall a b. TypeEquals a b => a -> b | ||
to = case proof (To (\a -> a)) of To f -> f | ||
|
||
newtype From a b = From (b -> a) | ||
|
||
from :: forall a b. TypeEquals a b => b -> a | ||
from = case proof (From (\a -> a)) of From f -> f |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,7 +70,17 @@ spec = do | |
|
||
Spec.describe "API pipelines run correctly" $ Spec.around withCleanEnv do | ||
Spec.it "Publish a legacy-converted package with unused deps" \{ workdir, index, metadata, storageDir, githubDir } -> do | ||
let testEnv = { workdir, index, metadata, username: "jon", storage: storageDir, github: githubDir } | ||
let | ||
testEnv = | ||
{ workdir | ||
, index | ||
, metadata | ||
, pursuitExcludes: Set.singleton (Utils.unsafePackageName "type-equality") | ||
, username: "jon" | ||
, storage: storageDir | ||
, github: githubDir | ||
} | ||
|
||
Assert.Run.runTestEffects testEnv do | ||
-- We'll publish [email protected] from the fixtures/github-packages | ||
-- directory, which has an unnecessary dependency on 'type-equality' | ||
|
@@ -123,6 +133,19 @@ spec = do | |
Left _ -> pure unit | ||
Right _ -> Except.throw $ "Expected publishing " <> formatPackageVersion name version <> " twice to fail." | ||
|
||
-- If we got here then the new published package is fine. There is one | ||
-- other successful code path: publishing a package that already exists | ||
-- but did not have documentation make it to Pursuit. | ||
let | ||
pursuitOnlyPublishArgs = | ||
{ compiler: Utils.unsafeVersion "0.15.9" | ||
, location: Just $ GitHub { owner: "purescript", repo: "purescript-type-equality", subdir: Nothing } | ||
, name: Utils.unsafePackageName "type-equality" | ||
, ref: "v4.0.1" | ||
, resolutions: Nothing | ||
} | ||
API.publish CurrentPackage pursuitOnlyPublishArgs | ||
|
||
where | ||
withCleanEnv :: (PipelineEnv -> Aff Unit) -> Aff Unit | ||
withCleanEnv action = do | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters