Skip to content

Instantly share code, notes, and snippets.

@ddellacosta
Last active March 7, 2019 02:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ddellacosta/910c09f284e6a1eabdf9d3c658547019 to your computer and use it in GitHub Desktop.
Save ddellacosta/910c09f284e6a1eabdf9d3c658547019 to your computer and use it in GitHub Desktop.
trying to patch tests for Diff package (transitive dependency)
self: super: {
haskell = super.haskell // {
packages = super.haskell.packages // {
ghc844 = with self.haskell.lib; super.haskell.packages.ghc844.extend (hself: hsuper: {
Diff = appendPatch hsuper.Diff /path/to/.config/nixpkgs/overlays/Diff-Test.patch;
});
};
};
}
@ddellacosta
Copy link
Author

ddellacosta commented Mar 6, 2019

# Diff-Test.patch
diff --git a/test/Test.hs b/test/Test.hs                                                                  
index 4a4b3c0..f663e99 100644                                                                             
--- a/test/Test.hs                                                                                        
+++ b/test/Test.hs                                                                                        
@@ -134,7 +134,7 @@ prop_ppDiffR :: DiffInput -> Property
 prop_ppDiffR (DiffInput le ri) =                                                                         
     let haskDiff=ppDiff $ getGroupedDiff le ri                                                           
         utilDiff= unsafePerformIO (runDiff (unlines le) (unlines ri))                                    
-    in  cover (haskDiff == utilDiff) 90 "exact match" $                                                  
+    in  cover 90 (haskDiff == utilDiff) "exact match" $                                                  
                 classify (haskDiff == utilDiff) "exact match"                                            
                         (div ((length haskDiff)*100) (length utilDiff) < 110) -- less than 10% bigger    
     where  

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment