Revision b3d17f52 htest/Test/Ganeti/Query/Filter.hs

b/htest/Test/Ganeti/Query/Filter.hs
42 42
import Ganeti.BasicTypes
43 43
import Ganeti.JSON
44 44
import Ganeti.Objects
45
import Ganeti.Query.Filter
45 46
import Ganeti.Query.Language
46 47
import Ganeti.Query.Query
47 48
import Ganeti.Utils (niceSort)
......
159 160
             "numeric value in non-list field"
160 161
           ]
161 162

  
163
-- | Tests make simple filter.
164
prop_makeSimpleFilter :: Property
165
prop_makeSimpleFilter =
166
  forAll (resize 10 $ listOf1 getName) $ \names ->
167
  forAll getName $ \namefield ->
168
  conjoin [ printTestCase "test expected names" $
169
              makeSimpleFilter namefield names ==?
170
              OrFilter (map (EQFilter namefield . QuotedString) names)
171
          , printTestCase "test empty names" $
172
              makeSimpleFilter namefield [] ==? EmptyFilter
173
          ]
174

  
162 175
testSuite "Query/Filter"
163 176
  [ 'prop_node_single_filter
164 177
  , 'prop_node_many_filter
165 178
  , 'prop_node_regex_filter
166 179
  , 'prop_node_bad_filter
180
  , 'prop_makeSimpleFilter
167 181
  ]

Also available in: Unified diff