packages feed

yamlscript 0.2.4.0 → 0.2.5.0

raw patch · 4 files changed

+7/−7 lines, 4 files

Files

lib/YAMLScript/FFI.hs view
@@ -27,7 +27,7 @@   c_graal_tear_down_isolate :: GraalIsolateThread -> IO CInt  -- | Foreign function interface to load_ys_to_json-foreign import capi "libys.0.2.4.h load_ys_to_json"+foreign import capi "libys.0.2.5.h load_ys_to_json"   c_load_ys_to_json :: GraalIsolateThread -> CString -> IO CString  -- | Create a GraalVM isolate and run an action with it
test/Test.hs view
@@ -22,7 +22,7 @@         [("data", Aeson.object [("foo", Aeson.String "bar")])]      it "evaluates YAMLScript function call" $ do-      result <- loadYAMLScript "!yamlscript/v0\nadd(40, 2)"+      result <- loadYAMLScript "!ys-0\nadd(40, 2)"       result `shouldBe` Aeson.object [("data", Aeson.Number 42)]      it "loads from file" $ do@@ -31,7 +31,7 @@         [("data", Aeson.object [("test", Aeson.String "value")])]      it "handles errors gracefully" $ do-      result <- loadYAMLScript "!yamlscript/v0\ninvalid: syntax"+      result <- loadYAMLScript "!ys-0\ninvalid: syntax"       case result of         Aeson.Object obj -> case KeyMap.lookup (Key.fromString "error") obj of           Just _ -> return () -- Error present, test passes
test/YAMLScript/Tests.hs view
@@ -42,18 +42,18 @@ yamlscriptTests :: Spec yamlscriptTests = describe "YAMLScript Features" $ do   it "evaluates arithmetic expressions" $ do-    result <- loadYAMLScript "!yamlscript/v0\nadd(2, 3)"+    result <- loadYAMLScript "!ys-0\nadd(2, 3)"     result `shouldBe` Aeson.object [("data", Aeson.Number 5)]    it "evaluates function calls" $ do-    result <- loadYAMLScript "!yamlscript/v0\ninc(41)"+    result <- loadYAMLScript "!ys-0\ninc(41)"     result `shouldBe` Aeson.object [("data", Aeson.Number 42)]  -- | Test error handling errorTests :: Spec errorTests = describe "Error Handling" $ do   it "returns error on invalid YAMLScript" $ do-    result <- loadYAMLScript "!yamlscript/v0\ninvalid: syntax"+    result <- loadYAMLScript "!ys-0\ninvalid: syntax"     case result of       Aeson.Object obj -> case KeyMap.lookup (Key.fromString "error") obj of         Just _ -> return () -- Error present, test passes
yamlscript.cabal view
@@ -1,6 +1,6 @@ cabal-version:      3.0 name:               yamlscript-version:            0.2.4.0+version:            0.2.5.0 synopsis:           Haskell bindings for YAMLScript description:        Haskell bindings for YAMLScript, a functional                     programming language with YAML syntax.