asLens :: TestTree
asLens = testGroup "asLens"
  [ testCase "get" $
      let l = queLens "{a,b}" :: Lens' Value (Int,Int)
       in val ^. l . _2 @?= two

  , testCase "getDoesNotExist" $
      -- doesn't work, make a Traversal?
      --d "{}" ^? queLens "{a}" @?= (Nothing :: Maybe (Int,Int))
      putStr "SKIPPED " >> pure ()

  , testCase "set" $
      (val & (queLens "{a,b}") .~ (two,one)) `jt` "{\"a\":2,\"b\":1}"
  ]
  where
    val = d "{\"a\":1,\"b\":2}"
    queLens :: (FromJSON a, ToJSON a) => Structure -> Lens' Value a
    queLens s = lens (.!s) (build s)
asLens :: TestTree
asLens = testGroup "asLens"
  [ testCase "get" $
      let l = queLens "{a,b}" :: Lens' Value (Int,Int)
       in val ^. l . _2 @?= two

  , testCase "getDoesNotExist" $
      -- doesn't work, make a Traversal?
      --d "{}" ^? queLens "{a}" @?= (Nothing :: Maybe (Int,Int))
      putStr "SKIPPED " >> pure ()

  , testCase "set" $
      (val & (queLens "{a,b}") .~ (two,one)) `jt` "{\"a\":2,\"b\":1}"
  ]
  where
    val = d "{\"a\":1,\"b\":2}"
    queLens :: (FromJSON a, ToJSON a) => Structure -> Lens' Value a
    queLens s = lens (.!s) (build s)
asLens = testGroup "asLens"
  [ testCase "get" $
      let l = queLens "{a,b}" :: Lens' Value (Int,Int)
       in val ^. l . _2 @?= two

  , testCase "getDoesNotExist" $
      -- doesn't work, make a Traversal?
      --d "{}" ^? queLens "{a}" @?= (Nothing :: Maybe (Int,Int))
      putStr "SKIPPED " >> pure ()

  , testCase "set" $
      (val & (queLens "{a,b}") .~ (two,one)) `jt` "{\"a\":2,\"b\":1}"
  ]
  where
    val = d "{\"a\":1,\"b\":2}"
    queLens :: (FromJSON a, ToJSON a) => Structure -> Lens' Value a
    queLens s = lens (.!s) (build s)