Skip to content

Commit fa633f5

Browse files
committed
Fix #1030: test case
When building with Cabal-3.6.*, Hackage server will accept the latest GHC LANGUAGE extensions (new in GHC 9.2).
1 parent 4675d01 commit fa633f5

File tree

5 files changed

+65
-1
lines changed

5 files changed

+65
-1
lines changed

tests/PackageTestMain.hs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,12 @@ badDirMangler entry =
6363

6464
cabalPackageCheckTests :: [TestTree]
6565
cabalPackageCheckTests =
66+
-- Failing tests
6667
[ testCase "Missing ./configure script" missingConfigureScriptTest
67-
, testCase "Missing directories in tar file" missingDirsInTarFileTest
6868
, testCase "Bad spec-version" badSpecVer
69+
-- Successful tests
70+
, testCase "Missing directories in tar file" missingDirsInTarFileTest
71+
, testCase "Accept GHC 9.2 LANGUAGE extensions" acceptGHC902LanguageExtensions
6972
]
7073

7174
---------------------------------------------------------------------------
@@ -109,6 +112,11 @@ missingDirsInTarFileTest =
109112
where
110113
pkg = "correct-package-0.1.0.0"
111114

115+
-- | Hackage should accept GHC 9.2 language extensions (issue #1030).
116+
117+
acceptGHC902LanguageExtensions :: Assertion
118+
acceptGHC902LanguageExtensions = successTest "LANGUAGE-GHC-9.2"
119+
112120
---------------------------------------------------------------------------
113121
-- * Auxiliary functions to construct tests
114122

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: LANGUAGE-GHC
2+
version: 9.2
3+
synopsis: Test for LANGUAGE extensions (issue #1030)
4+
description: Test whether Hackage accepts the latest LANGUAGE extensions
5+
license: BSD3
6+
license-file: LICENSE
7+
author: Hackage Server Team
8+
maintainer: [email protected]
9+
category: Test case
10+
build-type: Simple
11+
cabal-version: >=1.10
12+
13+
executable foo
14+
main-is: Main.hs
15+
build-depends: base >=4.16 && <4.17
16+
default-language: GHC2021
17+
default-extensions:
18+
-- These LANGUAGE extensions are new in GHC 9.2:
19+
NoFieldSelectors
20+
OverloadedRecordDot
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
Copyright (c) 2016, Hackage Server Team
2+
3+
All rights reserved.
4+
5+
Redistribution and use in source and binary forms, with or without
6+
modification, are permitted provided that the following conditions are met:
7+
8+
* Redistributions of source code must retain the above copyright
9+
notice, this list of conditions and the following disclaimer.
10+
11+
* Redistributions in binary form must reproduce the above
12+
copyright notice, this list of conditions and the following
13+
disclaimer in the documentation and/or other materials provided
14+
with the distribution.
15+
16+
* Neither the name of Hackage Server Team nor the names of other
17+
contributors may be used to endorse or promote products derived
18+
from this software without specific prior written permission.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module Main where
2+
3+
main :: IO ()
4+
main = putStrLn "Hello, Haskell!"
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import Distribution.Simple
2+
main = defaultMain

0 commit comments

Comments
 (0)