Ticket #7162: 7162-testsuite-fix.patch

File 7162-testsuite-fix.patch, 3.3 KB (added by afarmer, 2 years ago)

Move 7162 test to proper directory, add test to make sure INLINE [~] doesn't parse.

  • new file tests/parser/should_compile/T7162.hs

    From a1b785d805cb7db4c9641dc8537baa1f3fef6508 Mon Sep 17 00:00:00 2001
    From: Andrew Farmer <[email protected]>
    Date: Thu, 6 Dec 2012 15:53:38 -0600
    Subject: [PATCH] Move 7162 test to proper directory. Add additional test for
     7162.
    
    
    diff --git a/tests/parser/should_compile/T7162.hs b/tests/parser/should_compile/T7162.hs
    new file mode 100644
    index 0000000..e09b921
    - +  
     1import Data.Char 
     2 
     3{-# RULES "map-loop" [~] forall f . map' f = map' (id . f) #-} 
     4 
     5{-# NOINLINE map' #-} 
     6map' f [] = [] 
     7map' f (x:xs) = f x : map' f xs 
     8 
     9main = print (map' toUpper "Hello, World") 
  • tests/parser/should_compile/all.T

    diff --git a/tests/parser/should_compile/T7162.stderr b/tests/parser/should_compile/T7162.stderr
    new file mode 100644
    index 0000000..e69de29
    diff --git a/tests/parser/should_compile/all.T b/tests/parser/should_compile/all.T
    index 9d3b4e6..3c69e64 100644
    a b test('ParserLambdaCase', if_compiler_lt('ghc', '7.5', skip), compile, ['']) 
    9595test('T5243', extra_clean(['T5243A.hi', 'T5243A.o']), 
    9696     multimod_compile, ['T5243','']) 
    9797test('T7118', normal, compile, ['']) 
     98test('T7162', normal, compile, ['']) 
  • new file tests/parser/should_fail/T7162.hs

    diff --git a/tests/parser/should_fail/T7162.hs b/tests/parser/should_fail/T7162.hs
    new file mode 100644
    index 0000000..1c2164b
    - +  
     1{-# INLINE [~] f #-} 
     2f :: (Show a) => a -> String 
     3f x = show x 
     4 
     5main :: IO () 
     6main = putStrLn (f 54) 
  • new file tests/parser/should_fail/T7162.stderr

    diff --git a/tests/parser/should_fail/T7162.stderr b/tests/parser/should_fail/T7162.stderr
    new file mode 100644
    index 0000000..03702e3
    - +  
     1 
     2T7162.hs:1:14: parse error on input `]' 
  • tests/parser/should_fail/all.T

    diff --git a/tests/parser/should_fail/all.T b/tests/parser/should_fail/all.T
    index 355961d..6dc1a06 100644
    a b test('ParserNoLambdaCase', if_compiler_lt('ghc', '7.5', skip), compile_fail, ['' 
    7676test('ParserNoMultiWayIf', if_compiler_lt('ghc', '7.5', skip), compile_fail, ['']) 
    7777 
    7878test('T5425', normal, compile_fail, ['']) 
     79test('T7162', normal, compile_fail, ['']) 
  • deleted file tests/simplCore/should_compile/T7162.hs

    diff --git a/tests/simplCore/should_compile/T7162.hs b/tests/simplCore/should_compile/T7162.hs
    deleted file mode 100644
    index e09b921..0000000
    + -  
    1 import Data.Char 
    2  
    3 {-# RULES "map-loop" [~] forall f . map' f = map' (id . f) #-} 
    4  
    5 {-# NOINLINE map' #-} 
    6 map' f [] = [] 
    7 map' f (x:xs) = f x : map' f xs 
    8  
    9 main = print (map' toUpper "Hello, World") 
  • tests/simplCore/should_compile/all.T

    diff --git a/tests/simplCore/should_compile/T7162.stderr b/tests/simplCore/should_compile/T7162.stderr
    deleted file mode 100644
    index e69de29..0000000
    diff --git a/tests/simplCore/should_compile/all.T b/tests/simplCore/should_compile/all.T
    index 7c7138d..e9b9aa3 100644
    a b test('spec003', normal, compile, ['']) 
    3535 
    3636test('rule1', normal, compile, ['']) 
    3737test('rule2', only_ways(['optasm']), compile, ['-dsuppress-uniques']) 
    38 test('T7162', normal, compile, ['']) 
    3938 
    4039test('dfun-loop', normal, compile, ['']) 
    4140test('strict-float', normal, compile, [''])