From d2dd76b25728713671def7b5f52270738a6f9caf Mon Sep 17 00:00:00 2001 From: Peefy Date: Tue, 25 Jul 2023 21:37:51 +0800 Subject: [PATCH] chore: update test cases due to upgrade serde_yaml deps --- kclvm/runtime/src/manifests/tests.rs | 4 ++-- kclvm/runtime/src/manifests/yaml.rs | 4 ++-- kclvm/runtime/src/value/val_yaml.rs | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/kclvm/runtime/src/manifests/tests.rs b/kclvm/runtime/src/manifests/tests.rs index 86625bcdc..5a68e8902 100644 --- a/kclvm/runtime/src/manifests/tests.rs +++ b/kclvm/runtime/src/manifests/tests.rs @@ -17,7 +17,7 @@ fn test_kclvm_manifests_yaml_stream() { YamlEncodeOptions::default(), ), ( - "a:\n - 1\n - 2\n - 3\nb: s\n", + "a:\n- 1\n- 2\n- 3\nb: s\n", ValueRef::list(Some(&[&ValueRef::dict(Some(&[ ("a", &ValueRef::list_int(&[1, 2, 3])), ("b", &ValueRef::str("s")), @@ -36,7 +36,7 @@ fn test_kclvm_manifests_yaml_stream() { }, ), ( - "a: 1\nb: ~\n", + "a: 1\nb: null\n", ValueRef::list(Some(&[&ValueRef::dict(Some(&[ ("a", &ValueRef::int(1)), ("b", &ValueRef::none()), diff --git a/kclvm/runtime/src/manifests/yaml.rs b/kclvm/runtime/src/manifests/yaml.rs index 3ef949948..47ee12d63 100644 --- a/kclvm/runtime/src/manifests/yaml.rs +++ b/kclvm/runtime/src/manifests/yaml.rs @@ -39,7 +39,7 @@ mod test_manifests_yaml { YamlEncodeOptions::default(), ), ( - "a:\n - 1\n - 2\n - 3\nb: s\n", + "a:\n- 1\n- 2\n- 3\nb: s\n", ValueRef::list(Some(&[&ValueRef::dict(Some(&[ ("a", &ValueRef::list_int(&[1, 2, 3])), ("b", &ValueRef::str("s")), @@ -58,7 +58,7 @@ mod test_manifests_yaml { }, ), ( - "a: 1\nb: ~\n", + "a: 1\nb: null\n", ValueRef::list(Some(&[&ValueRef::dict(Some(&[ ("a", &ValueRef::int(1)), ("b", &ValueRef::none()), diff --git a/kclvm/runtime/src/value/val_yaml.rs b/kclvm/runtime/src/value/val_yaml.rs index 81eaf8896..70e149841 100644 --- a/kclvm/runtime/src/value/val_yaml.rs +++ b/kclvm/runtime/src/value/val_yaml.rs @@ -156,7 +156,7 @@ mod test_value_yaml { ), ( "a:\n- 1\n -2\n-3", - "while parsing a block mapping, did not find expected key at line 4 column 1", + "could not find expected ':' at line 5 column 1, while scanning a simple key at line 4 column 1", ), ]; for (yaml_str, expected) in cases { @@ -192,7 +192,7 @@ mod test_value_yaml { ), ( "b:3\n---\na:\n- 1\n -2\n-3", - "while parsing a block mapping, did not find expected key at line 6 column 1", + "could not find expected ':' at line 7 column 1, while scanning a simple key at line 6 column 1", ), ]; for (yaml_str, expected) in cases { @@ -214,7 +214,7 @@ mod test_value_yaml { ("a", &ValueRef::list_int(&[1, 2, 3])), ("b", &ValueRef::str("s")), ])), - "a:\n - 1\n - 2\n - 3\nb: s\n", + "a:\n- 1\n- 2\n- 3\nb: s\n", ), ]; for (value, expected) in cases { @@ -271,7 +271,7 @@ mod test_value_yaml { ("b", &ValueRef::list_int(&[1, 2, 3])), ("a", &ValueRef::str("s")), ])), - "a: s\nb:\n - 1\n - 2\n - 3\n", + "a: s\nb:\n- 1\n- 2\n- 3\n", YamlEncodeOptions { sort_keys: true, ignore_private: false,