Displaying 13 results from an estimated 13 matches for "test_string".
2012 Apr 23
4
Multiple regex match in the same line
Hi,
Could somebody please show me a way to find, and display multiple
regex matches in the same line?
Like this:
test_string = "I shot the Sherrif but I didn''t shot the Deputy."
# The word I would like to find is the "shot" and displayed like
"shotshot" or like each match could go into a new #line like:
"shot"
"shot"
# Some ways I tried:
regex = /shot/ =~ test_...
2015 Jan 23
0
[PATCH 2/2] mllib: add simple tests for the JSON module
...s. *)
+let assert_equal_string = assert_equal ~printer:(fun x -> x)
+
+(* "basic" suite. *)
+let test_empty () =
+ let doc = [] in
+ assert_equal_string "{}" (JSON.string_of_doc doc);
+ assert_equal_string "{
+}" (JSON.string_of_doc ~fmt:JSON.Indented doc)
+
+let test_string () =
+ let doc = [ "test_string", JSON.String "foo"; ] in
+ assert_equal_string "{ \"test_string\": \"foo\" }"
+ (JSON.string_of_doc doc);
+ assert_equal_string "{
+ \"test_string\": \"foo\"
+}"
+ (JSON.string...
2015 Jan 23
2
[PATCH 1/2] mllib: tests: add tests for string_lines_split
...inter:(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 "" "baz");
assert_equal_int (-1) (string_find "foobar" "baz")
+(* Test Common_utils.string_lines_split. *)
+let test_string_lines_split () =
+ assert_equal_stringlist [""] (string_lines_split &qu...
2015 May 11
3
[PATCH 1/2] mllib: Require OUnit2 for tests.
...l_string = assert_equal ~printer:(fun x -> x)
(* "basic" suite. *)
-let test_empty () =
+let test_empty ctx =
let doc = [] in
assert_equal_string "{}" (JSON.string_of_doc doc);
assert_equal_string "{
}" (JSON.string_of_doc ~fmt:JSON.Indented doc)
-let test_string () =
+let test_string ctx =
let doc = [ "test_string", JSON.String "foo"; ] in
assert_equal_string "{ \"test_string\": \"foo\" }"
(JSON.string_of_doc doc);
@@ -39,7 +39,7 @@ let test_string () =
}"
(JSON.string_of_doc ~fmt:JSON...
2012 Aug 09
2
[LLVMdev] Compiling std::string with clang
...ant topics within the list archive,
When I am trying to compile a simple code, containing access to
std::string, with clang:
#include <string>
int main()
{
std::string s;
return 0;
}
I am getting a plenty of following errors:
In file included from test_string.cpp:1:
In file included from
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/string:46:
In file included from
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/char_traits.h:46:
In file included from
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../...
2006 Jun 16
5
BackgrounDRb / Testing Error: uninitialized constant BackgrounDRb
I''m digging into BackgrounDRb and having some problems testing a worker class.
The following line in my test (created from script/generate worker
Test) throws an error:
worker = TestWorker.new(:test_string => "testing...")
Error:
/activesupport/lib/active_support/dependencies.rb:123:in
`const_missing'': uninitialized constant BackgrounDRb (NameError)
from /Users/itsderek23/Projects/drb_test/config/../vendor/rails/activerecord/lib/../../activesupport/lib/active_support/d...
2015 Oct 06
0
[PATCH 5/5] mllib: Replace various ad hoc string_* functions with String.*
...4
--- a/mllib/common_utils_tests.ml
+++ b/mllib/common_utils_tests.ml
@@ -84,21 +84,21 @@ let test_human_size ctx =
assert_equal_string "3.4G" (human_size 3650722201_L);
assert_equal_string "-3.4G" (human_size (-3650722201_L))
-(* 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_...
2015 Oct 06
10
[PATCH 0/5] mllib: Hide bad String functions and miscellaneous refactoring.
Hide/prevent the use of bad string functions like String.lowercase.
These are replaced by safe functions that won't break UTF-8 strings.
Other miscellaneous refactoring.
Rich.
2018 Jun 12
8
[PATCH 0/3] Use sbitmap instead of percpu_ida
Removing the percpu_ida code nets over 400 lines of removal. It's not
as spectacular as deleting an entire architecture, but it's still a
worthy reduction in lines of code.
Untested due to lack of hardware and not understanding how to set up a
target platform.
Changes from v1:
- Fixed bugs pointed out by Jens in iscsit_wait_for_tag()
- Abstracted out tag freeing as requested by Bart
2018 Jun 12
8
[PATCH 0/3] Use sbitmap instead of percpu_ida
Removing the percpu_ida code nets over 400 lines of removal. It's not
as spectacular as deleting an entire architecture, but it's still a
worthy reduction in lines of code.
Untested due to lack of hardware and not understanding how to set up a
target platform.
Changes from v1:
- Fixed bugs pointed out by Jens in iscsit_wait_for_tag()
- Abstracted out tag freeing as requested by Bart
2018 May 15
6
[PATCH 0/2] Use sbitmap instead of percpu_ida
From: Matthew Wilcox <mawilcox at microsoft.com>
This is a pretty rough-and-ready conversion of the target drivers
from using percpu_ida to sbitmap. It compiles; I don't have a target
setup, so it's completely untested. I haven't tried to do anything
particularly clever here, so it's possible that, for example, the wait
queue in iscsi_target_util could be more clever, like
2018 Aug 20
6
[PATCH 0/4] mltools: JSON unification
An evolution of:
https://www.redhat.com/archives/libguestfs/2018-August/msg00155.html
2017 Sep 26
5
[PATCH 0/5] Miscellaneous refactoring of common/utils, create common/mltools
Miscellaneous refactoring, but the main one is to rename mllib/
as common/mltools/
Rich.