search for: assert_is_number

Displaying 7 results from an estimated 7 matches for "assert_is_number".

2018 Aug 20
0
[PATCH 4/4] mltools: JSON: unify JSON_parser type with JSON.json_t.
...false) + (match value with | JSON.Dict _ -> true | _ -> false) let assert_is_string exp = function - | JSON_parser_string s -> assert_equal_string exp s + | JSON.String s -> assert_equal_string exp s | _ as v -> assert_failure (type_mismatch_string "string" v) let assert_is_number exp = function - | JSON_parser_number n -> assert_equal_int64 exp n - | JSON_parser_double d -> assert_equal_int64 exp (Int64.of_float d) + | JSON.Int i -> assert_equal_int64 exp i + | JSON.Float f -> assert_equal_int64 exp (Int64.of_float f) | _ as v -> assert_failure (type_m...
2018 Aug 22
3
[PATCH v2 0/2] mltools: JSON: unify JSON & JSON parser.
v2: - Added back the null value. - Reran the tests. Rich.
2018 Aug 23
2
[PATCH 1/2] mltools: JSON: add json_parser_tree_parse_file
...string in the [yv] structure *) diff --git a/common/mltools/JSON_parser_tests.ml b/common/mltools/JSON_parser_tests.ml index 024817711..286724616 100644 --- a/common/mltools/JSON_parser_tests.ml +++ b/common/mltools/JSON_parser_tests.ml @@ -122,6 +122,28 @@ let test_tree_parse_inspect ctx = assert_is_number 10_L (List.nth a 2); assert_is_number 2_L (List.assoc "second" l) +let test_tree_parse_file_basic ctx = + begin + let tmpfile, chan = bracket_tmpfile ctx in + output_string chan "{}\n"; + flush chan; + close_out chan; + let value = json_parser_tree_parse_fil...
2018 Aug 20
6
[PATCH 0/4] mltools: JSON unification
An evolution of: https://www.redhat.com/archives/libguestfs/2018-August/msg00155.html
2015 Sep 07
5
[PATCH 0/4 v3] builder: support for Simple Streams metadata
Hi, this series adds a basic support for Simple Streams v1.0 metadata files. This makes it possible to create a repository .conf files with [cirros] uri=http://download.cirros-cloud.net format=simplestreams to read the latest version of each CirrOS image. Thanks, Pino Toscano (4): builder: add non-int revisions builder: add simple libyajl binding build: expose HAVE_YAJL to automake
2018 Aug 17
0
[PATCH v3 1/4] mltools: Rename Yajl module as JSON_parser and move to common/mltools.
...(match value with | JSON_parser_object _ -> true | _ -> false) let assert_is_string exp = function - | Yajl_string s -> assert_equal_string exp s + | JSON_parser_string s -> assert_equal_string exp s | _ as v -> assert_failure (type_mismatch_string "string" v) let assert_is_number exp = function - | Yajl_number n -> assert_equal_int64 exp n - | Yajl_double d -> assert_equal_int64 exp (Int64.of_float d) + | JSON_parser_number n -> assert_equal_int64 exp n + | JSON_parser_double d -> assert_equal_int64 exp (Int64.of_float d) | _ as v -> assert_failure (ty...
2018 Aug 17
8
[PATCH v3 4/4] v2v: Add --print-estimate option to print copy size
I rethought this again, as I think that it's a dangerous assumption to bake qemu-img measure output into our API. This patch series runs qemu-img measure behind the scenes, but then parses the output and sums it to a single number which we print. Doing that required a bit of reworking, moving the Jansson [JSON parser] bindings from virt-builder into the common directory and a couple of other