[Libguestfs] [PATCH 5/5] mllib: Replace various ad hoc string_* functions with String.*

Richard W.M. Jones rjones at redhat.com
Tue Oct 6 12:38:34 UTC 2015


On Tue, Oct 06, 2015 at 01:30:50PM +0100, Richard W.M. Jones wrote:
> -(* Test Common_utils.string_prefix. *)
> -let test_string_prefix ctx =
> -  assert_bool "string_prefix,," (string_prefix "" "");
> -  assert_bool "string_prefix,foo," (string_prefix "foo" "");
> -  assert_bool "string_prefix,foo,foo" (string_prefix "foo" "foo");
> -  assert_bool "string_prefix,foo123,foo" (string_prefix "foo123" "foo");
> -  assert_bool "not (string_prefix,,foo" (not (string_prefix "" "foo"))
> +(* Test Common_utils.String.is_prefix. *)
> +let test_String.is_prefix ctx =
> +  assert_bool "String.is_prefix,," (String.is_prefix "" "");
> +  assert_bool "String.is_prefix,foo," (String.is_prefix "foo" "");
> +  assert_bool "String.is_prefix,foo,foo" (String.is_prefix "foo" "foo");
> +  assert_bool "String.is_prefix,foo123,foo" (String.is_prefix "foo123" "foo");
> +  assert_bool "not (String.is_prefix,,foo" (not (String.is_prefix "" "foo"))

Hmm, that's not right!

An overenthusiastic Perl script.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
libguestfs lets you edit virtual machines.  Supports shell scripting,
bindings from many languages.  http://libguestfs.org




More information about the Libguestfs mailing list