mirror of
https://github.com/facebook/duckling.git
synced 2024-12-01 08:19:36 +03:00
7889f396f3
Summary: Pull Request resolved: https://github.com/facebook/duckling/pull/533 In recent versions of Data.Some the name of the constructor, `This` has changed name to `Some`. This has become rather problematic for us to migrate so we're just going to remove the dependency. The meat of this diff is adding the type `Seal` to `Duckling.Types`. That type replaces `Some`. Reviewed By: pepeiborra Differential Revision: D23929459 fbshipit-source-id: 8ff4146ecba4f1119a17899961b2d877547f6e4f
38 lines
993 B
Haskell
38 lines
993 B
Haskell
-- Copyright (c) 2016-present, Facebook, Inc.
|
|
-- All rights reserved.
|
|
--
|
|
-- This source code is licensed under the BSD-style license found in the
|
|
-- LICENSE file in the root directory of this source tree.
|
|
|
|
|
|
module Duckling.Time.DE.Tests
|
|
( tests ) where
|
|
|
|
import Data.String
|
|
import Prelude
|
|
import Test.Tasty
|
|
import Test.Tasty.HUnit
|
|
|
|
import Duckling.Dimensions.Types
|
|
import Duckling.Locale
|
|
import Duckling.Resolve
|
|
import Duckling.Testing.Asserts
|
|
import Duckling.Testing.Types (testContext, testOptions)
|
|
import Duckling.Time.DE.Corpus
|
|
import Duckling.Types (Range(..))
|
|
|
|
tests :: TestTree
|
|
tests = testGroup "DE Tests"
|
|
[ makeCorpusTest [Seal Time] corpus
|
|
, makeNegativeCorpusTest [Seal Time] negativeCorpus
|
|
, rangeTests
|
|
]
|
|
|
|
rangeTests :: TestTree
|
|
rangeTests = testCase "Range Test" $
|
|
mapM_ (analyzedRangeTest (testContext{locale = makeLocale DE Nothing})
|
|
testOptions . withTargets [Seal Time]) xs
|
|
where
|
|
xs = [ ("Wir treffen uns am 17 Uhr am KiLa.", Range 16 25)
|
|
]
|