Displaying 20 results from an estimated 27 matches for "assert_equal_stringlist".
2017 Jan 30
0
[PATCH v6 2/3] mllib: modify nsplit to take optional noempty and count arguments
...ts.ml
@@ -109,6 +109,35 @@ let test_string_find ctx =
assert_equal_int (-1) (String.find "" "baz");
assert_equal_int (-1) (String.find "foobar" "baz")
+(* Test Common_utils.String.nsplit *)
+let test_string_nsplit ctx =
+ (* Basic functionality *)
+ assert_equal_stringlist [""] (String.nsplit "|" "");
+ assert_equal_stringlist ["A"] (String.nsplit "|" "A");
+ assert_equal_stringlist ["A"; "B"] (String.nsplit "|" "A|B");
+ assert_equal_stringlist ["A"; &quo...
2016 Dec 18
0
[PATCH v4 4/6] mllib: modify nsplit to take optional noempty and count arguments
...ts.ml
@@ -109,6 +109,32 @@ let test_string_find ctx =
assert_equal_int (-1) (String.find "" "baz");
assert_equal_int (-1) (String.find "foobar" "baz")
+(* Test Common_utils.String.nsplit *)
+let test_string_nsplit ctx =
+ (* Basic functionality *)
+ assert_equal_stringlist [""] (String.nsplit "," "");
+ assert_equal_stringlist ["A"] (String.nsplit "," "A");
+ assert_equal_stringlist ["A"; "B"] (String.nsplit "," "A,B");
+ assert_equal_stringlist ["A"; &quo...
2019 Jan 16
1
Re: [PATCH 3/5] mltools: add simple tests for external_command
...t_equal ~printer:(fun x -> string_of_int x)
> let assert_equal_int64 = assert_equal ~printer:(fun x -> Int64.to_string x)
> let assert_equal_intlist = assert_equal ~printer:(fun x -> "(" ^ (String.concat ";" (List.map string_of_int x)) ^ ")")
> +let assert_equal_stringlist = assert_equal ~printer:(fun x -> "(" ^ (String.escaped (String.concat "," x)) ^ ")")
>
> (* Test Tools_utils.parse_size and Tools_utils.parse_resize. *)
> let test_parse_resize ctx =
> @@ -156,6 +157,26 @@ let test_run_commands ctx =
> end;
&g...
2015 Jan 23
2
[PATCH 1/2] mllib: tests: add tests for string_lines_split
...tils_tests.ml
@@ -27,6 +27,7 @@ let prog = "common_utils_tests"
let assert_equal_string = assert_equal ~printer:(fun x -> x)
let assert_equal_int = assert_equal ~printer:(fun x -> string_of_int x)
let assert_equal_int64 = assert_equal ~printer:(fun x -> Int64.to_string x)
+let assert_equal_stringlist = assert_equal ~printer:(fun x -> "(" ^ (String.escaped (String.concat "," x)) ^ ")")
(* Test Common_utils.int_of_le32 and Common_utils.le32_of_int. *)
let test_le32 () =
@@ -110,6 +111,22 @@ let test_string_find () =
assert_equal_int (-1) (string_find "...
2019 Jan 16
0
[PATCH 3/5] mltools: add simple tests for external_command
...ual_int = assert_equal ~printer:(fun x -> string_of_int x)
let assert_equal_int64 = assert_equal ~printer:(fun x -> Int64.to_string x)
let assert_equal_intlist = assert_equal ~printer:(fun x -> "(" ^ (String.concat ";" (List.map string_of_int x)) ^ ")")
+let assert_equal_stringlist = assert_equal ~printer:(fun x -> "(" ^ (String.escaped (String.concat "," x)) ^ ")")
(* Test Tools_utils.parse_size and Tools_utils.parse_resize. *)
let test_parse_resize ctx =
@@ -156,6 +157,26 @@ let test_run_commands ctx =
end;
()
+let test_external_...
2017 Jan 11
3
[PATCH v5 0/3] Import directly from OVA tar archive if possible
v5:
- rebase, patches 1,3,5 were merged
- 1/3: we still need to discuss whether to detect compressed discs
- 2/3:
- renamed argument noempty to keep_empty
- tests were not run
- 3/3:
- using JSON module to generate JSON (as suggested by Pino)
- all the other comments raised by Pino
v4:
- rebase to more recent master
- 1/6: using just "quote" instead of
2019 Jan 16
10
[PATCH 0/5] [RFC] builder: handle unavailable repos
In case a repository of virt-builder references files (e.g. the index)
that cannot be downloaded (network issues, 404, etc) then virt-builder
errors out on this situation. This is not a nice situation, from an user
POV.
This series does some refactoring to allow to better handle downloading
failures, and handle the failures gracefully in virt-builder.
RFC because I'm not yet too convinced
2019 Feb 25
0
[PATCH 2/3] v2v: add Var_expander
...should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *)
+
+open OUnit
+
+let assert_equal_string = assert_equal ~printer:(fun x -> x)
+let assert_equal_stringlist = assert_equal ~printer:(fun x -> "(" ^ (String.escaped (String.concat "," x)) ^ ")")
+
+let replace_none_fn _ = None
+let replace_empty_fn _ = Some ""
+
+let test_no_replacement () =
+ assert_equal_string "" (Var_expander.replace_fn ""...
2016 Dec 18
9
[PATCH v4 0/6] Import directly from OVA tar archive if possible
v4:
- rebase to more recent master
- 1/6: using just "quote" instead of "Filename.quote"
- 2/6: reformated block of code according to Richards suggestion
- 4/6: added tests for nsplit
v3: Addressed Pino's comments, namely:
- input_ova.ml
- untar takes list of paths
- renamed untar_partial to untar_metadata
- replaced uggly regex with nsplit
- tests
- test changes
2017 Jan 30
6
[PATCH v6 0/3] Import directly from OVA tar archive if possible
v6:
- just rebase
v5:
- rebase, patches 1,3,5 were merged
- 1/3: we still need to discuss whether to detect compressed discs
- 2/3:
- renamed argument noempty to keep_empty
- tests were not run
- 3/3:
- using JSON module to generate JSON (as suggested by Pino)
- all the other comments raised by Pino
v4:
- rebase to more recent master
- 1/6: using just "quote" instead of
2017 Jun 15
0
[PATCH v6 04/41] mllib: Split ‘Common_utils’ into ‘Std_utils’ + ‘Common_utils’.
...s the Std_utils module. *)
+
+open OUnit2
+open Std_utils
+
+(* Utils. *)
+let assert_equal_string = assert_equal ~printer:(fun x -> x)
+let assert_equal_int = assert_equal ~printer:(fun x -> string_of_int x)
+let assert_equal_int64 = assert_equal ~printer:(fun x -> Int64.to_string x)
+let assert_equal_stringlist = assert_equal ~printer:(fun x -> "(" ^ (String.escaped (String.concat "," x)) ^ ")")
+
+let test_subdirectory ctx =
+ assert_equal_string "" (subdirectory "/foo" "/foo");
+ assert_equal_string "" (subdirectory "/foo&qu...
2017 Apr 07
1
[PATCH 1/2] mllib: add new Common_utils.run_commands
.../common_utils_tests.ml
+++ b/mllib/common_utils_tests.ml
@@ -26,6 +26,7 @@ let assert_equal_string = assert_equal ~printer:(fun x -> x)
let assert_equal_int = assert_equal ~printer:(fun x -> string_of_int x)
let assert_equal_int64 = assert_equal ~printer:(fun x -> Int64.to_string x)
let assert_equal_stringlist = assert_equal ~printer:(fun x -> "(" ^ (String.escaped (String.concat "," x)) ^ ")")
+let assert_equal_intlist = assert_equal ~printer:(fun x -> "(" ^ (String.concat ";" (List.map string_of_int x)) ^ ")")
let test_subdirectory ct...
2015 May 11
3
[PATCH 1/2] mllib: Require OUnit2 for tests.
...neral Public License as published by
@@ -18,7 +18,7 @@
(* This file tests the Common_utils module. *)
-open OUnit
+open OUnit2
open Common_utils
let prog = "common_utils_tests"
@@ -30,12 +30,12 @@ let assert_equal_int64 = assert_equal ~printer:(fun x -> Int64.to_string x)
let assert_equal_stringlist = assert_equal ~printer:(fun x -> "(" ^ (String.escaped (String.concat "," x)) ^ ")")
(* Test Common_utils.int_of_le32 and Common_utils.le32_of_int. *)
-let test_le32 () =
+let test_le32 ctx =
assert_equal_int64 0x20406080L (int_of_le32 "\x80\x60\x40\x20&...
2017 Jun 20
2
[PATCH v2 1/2] mllib: add new Common_utils.run_commands
.../common_utils_tests.ml
+++ b/mllib/common_utils_tests.ml
@@ -26,6 +26,7 @@ let assert_equal_string = assert_equal ~printer:(fun x -> x)
let assert_equal_int = assert_equal ~printer:(fun x -> string_of_int x)
let assert_equal_int64 = assert_equal ~printer:(fun x -> Int64.to_string x)
let assert_equal_stringlist = assert_equal ~printer:(fun x -> "(" ^ (String.escaped (String.concat "," x)) ^ ")")
+let assert_equal_intlist = assert_equal ~printer:(fun x -> "(" ^ (String.concat ";" (List.map string_of_int x)) ^ ")")
let test_subdirectory ct...
2017 Sep 22
27
[PATCH v3 00/22] Replace almost all uses of the Str module with PCRE.
v1:
https://www.redhat.com/archives/libguestfs/2017-September/msg00135.html
v2:
https://www.redhat.com/archives/libguestfs/2017-September/msg00158.html
v3 is almost identical to v2, but I have added 4 extra commits to
almost finish the job of replacing Str everywhere possible (note it's
not possible to replace Str in common/mlstdutils or the generator
because those are pure OCaml).
As
2019 Mar 29
5
[PATCH v2 0/3] v2v: add -o json output mode
This series adds a new output mode for virt-v2v, called -o json.
It produces local files, just like -o local, although the metadata
produced is a JSON file with data that v2v collected in the conversion
process. This can be useful for converting to unsupported destinations,
still based on QEMU/KVM.
In addition to a simple different metadata, it offers a way to relocate
the disks, with
2019 Feb 25
7
[PATCH 0/3] RFC: v2v: add -o json output mode
This series adds a new output mode for virt-v2v, called -o json.
It produces local files, just like -o local, although the metadata
produced is a JSON file with data that v2v collected in the conversion
process. This can be useful for converting to unsupported destinations,
still based on QEMU/KVM.
In addition to a simple different metadata, it offers a way to relocate
the disks, with
2017 Jun 19
16
[PATCH v7 00/13] Refactor utilities
This is just the utilities part of the patch series from:
https://www.redhat.com/archives/libguestfs/2017-June/msg00103.html
I believe this addresses everything raised in comments on that
patch series.
Rich.
2019 Jan 11
3
[PATCH 1/3] mlstdutils: add a very simple test for Std_utils.which
...index 81f512cbf..f7b0247a4 100644
--- a/common/mlstdutils/std_utils_tests.ml
+++ b/common/mlstdutils/std_utils_tests.ml
@@ -29,6 +29,11 @@ let assert_equal_int = assert_equal ~printer:(fun x -> string_of_int x)
let assert_equal_int64 = assert_equal ~printer:(fun x -> Int64.to_string x)
let assert_equal_stringlist = assert_equal ~printer:(fun x -> "(" ^ (String.escaped (String.concat "," x)) ^ ")")
let assert_equal_stringpair = assert_equal ~printer:(fun (x, y) -> sprintf "%S, %S" x y)
+let assert_nonempty_string str =
+ if str = "" then
+ assert_f...
2017 Jun 09
12
[PATCH 00/12] Refactor utility functions.
This turned out to be rather more involved than I thought.
We have lots of utility functions, spread all over the repository,
with not a lot of structure. This moves many of them under common/
and structures them so there are clear dependencies.
This doesn't complete the job by any means. Other items I had on my
to-do list for this change were:
- Split up mllib/common_utils into:
-