Skip to content

Commit 85e2bee

Browse files
committed
fix test failures
- unicode tests live in coretest crate - libcollections str tests need UnicodeChar trait. - libregex perlw tests were checking a char in the Alphabetic category, \x2161. Confirmed perl 5.18 considers this a \w character. Changed to \x2961, which is not \w as the test expects.
1 parent 5d4238b commit 85e2bee

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

mk/crates.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
TARGET_CRATES := libc std green rustuv native flate arena glob term semver \
5353
uuid serialize sync getopts collections num test time rand \
5454
url log regex graphviz core rlibc alloc debug rustrt \
55-
unicode
55+
unicode
5656
HOST_CRATES := syntax rustc rustdoc fourcc hexfloat regex_macros fmt_macros
5757
CRATES := $(TARGET_CRATES) $(HOST_CRATES)
5858
TOOLS := compiletest rustdoc rustc

mk/tests.mk

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515

1616
# The names of crates that must be tested
1717

18-
# libcore tests are in a separate crate
18+
# libcore/libunicode tests are in a separate crate
1919
DEPS_coretest :=
2020
$(eval $(call RUST_CRATE,coretest))
2121

22-
TEST_TARGET_CRATES = $(filter-out core,$(TARGET_CRATES)) coretest
22+
TEST_TARGET_CRATES = $(filter-out core unicode,$(TARGET_CRATES)) coretest
2323
TEST_DOC_CRATES = $(DOC_CRATES)
2424
TEST_HOST_CRATES = $(HOST_CRATES)
2525
TEST_CRATES = $(TEST_TARGET_CRATES) $(TEST_HOST_CRATES)

src/libcollections/str.rs

+2
Original file line numberDiff line numberDiff line change
@@ -972,6 +972,8 @@ mod tests {
972972
use string::String;
973973
use vec::Vec;
974974

975+
use unicode::UnicodeChar;
976+
975977
#[test]
976978
fn test_eq_slice() {
977979
assert!((eq_slice("foobar".slice(0, 3), "foo")));

src/libregex/test/tests.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,8 @@ mat!(uni_case_lower, r"\p{Ll}+", "ΛΘΓΔα", Some((8, 10)))
195195

196196
// Test the Unicode friendliness of Perl character classes.
197197
mat!(uni_perl_w, r"\w+", "dδd", Some((0, 4)))
198-
mat!(uni_perl_w_not, r"\w+", "", None)
199-
mat!(uni_perl_w_neg, r"\W+", "", Some((0, 3)))
198+
mat!(uni_perl_w_not, r"\w+", "", None)
199+
mat!(uni_perl_w_neg, r"\W+", "", Some((0, 3)))
200200
mat!(uni_perl_d, r"\d+", "1२३9", Some((0, 8)))
201201
mat!(uni_perl_d_not, r"\d+", "Ⅱ", None)
202202
mat!(uni_perl_d_neg, r"\D+", "Ⅱ", Some((0, 3)))

0 commit comments

Comments
 (0)