अगर मैंमेरे परीक्षण विफल होने पर मेरा HUnit परीक्षण सूट क्यों पास हो जाता है?
module Main where
import Test.HUnit
test1 :: Test
test1 = TestCase $ assertEqual "Should be one" 1 5
test2 :: Test
test2 = TestCase $ assertEqual "Shold both be zero" 0 0
main :: IO Counts
main = runTestTT $ TestList [test1, test2, test1]
साथ test/Test.hs
है और
test-suite my-test
type: exitcode-stdio-1.0
hs-source-dirs: test
main-is: Test.hs
build-depends: base >= 4.8.1.0 && <4.9,
HUnit >= 1.3
default-language: Haskell2010
के साथ एक .cabal
और मैं cabal test --show-details='always'
चलाने तो मैं मिल
Test suite my-test: RUNNING...
### Failure in: 0
test/Test.hs:6
Should be one
expected: 1
but got: 5
### Failure in: 2
test/Test.hs:6
Should be one
expected: 1
but got: 5
Cases: 3 Tried: 3 Errors: 0 Failures: 2
Test suite my-test: PASS
अपने परीक्षण सूट पास करता है क्यों जब मैं मिला है विफलताओं? इसी तरह, अगर मैं cabal sdist
मुझे कोई चेतावनी नहीं है कि मेरे परीक्षण विफल हो गए हैं।
मैंने 'विस्तृत-0.9' में देखा था, लेकिन [vibe मिला] (http://stackoverflow.com/a/18686329/656912) कि यह कम स्थिर और उपयोग करने में कठोर था। – orome
@raxacoricofallapatorius, हो सकता है। मैंने कभी भी गड़बड़ नहीं की है; मैंने केवल मौजूदा परियोजनाओं में मौजूदा परीक्षण सूट का विस्तार किया है। – dfeuer
@dfeuer: मैंने 'ExitSuccess' और 'ExitFailure' के साथ अपना दृष्टिकोण उपयोग किया है, लेकिन अगर मैं' कैबल टेस्ट - शो-विवरण = 'हमेशा' चलाता हूं तो यह किसी कारण से काम नहीं करता है - बिल्ड टेस्ट सूट कहता है: पास भी एक विफलता है। क्या आप कृपया कामकाज की सिफारिश कर सकते हैं? – altern