Skip to content

Commit

Permalink
fix test failures
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
kwantam committed Jul 9, 2014
1 parent 5d4238b commit 85e2bee
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion mk/crates.mk
Expand Up @@ -52,7 +52,7 @@
TARGET_CRATES := libc std green rustuv native flate arena glob term semver \
uuid serialize sync getopts collections num test time rand \
url log regex graphviz core rlibc alloc debug rustrt \
unicode
unicode
HOST_CRATES := syntax rustc rustdoc fourcc hexfloat regex_macros fmt_macros
CRATES := $(TARGET_CRATES) $(HOST_CRATES)
TOOLS := compiletest rustdoc rustc
Expand Down
4 changes: 2 additions & 2 deletions mk/tests.mk
Expand Up @@ -15,11 +15,11 @@

# The names of crates that must be tested

# libcore tests are in a separate crate
# libcore/libunicode tests are in a separate crate
DEPS_coretest :=
$(eval $(call RUST_CRATE,coretest))

TEST_TARGET_CRATES = $(filter-out core,$(TARGET_CRATES)) coretest
TEST_TARGET_CRATES = $(filter-out core unicode,$(TARGET_CRATES)) coretest
TEST_DOC_CRATES = $(DOC_CRATES)
TEST_HOST_CRATES = $(HOST_CRATES)
TEST_CRATES = $(TEST_TARGET_CRATES) $(TEST_HOST_CRATES)
Expand Down
2 changes: 2 additions & 0 deletions src/libcollections/str.rs
Expand Up @@ -972,6 +972,8 @@ mod tests {
use string::String;
use vec::Vec;

use unicode::UnicodeChar;

#[test]
fn test_eq_slice() {
assert!((eq_slice("foobar".slice(0, 3), "foo")));
Expand Down
4 changes: 2 additions & 2 deletions src/libregex/test/tests.rs
Expand Up @@ -195,8 +195,8 @@ mat!(uni_case_lower, r"\p{Ll}+", "ΛΘΓΔα", Some((8, 10)))

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

5 comments on commit 85e2bee

@bors
Copy link
Contributor

@bors bors commented on 85e2bee Jul 9, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from alexcrichton
at kwantam@85e2bee

@bors
Copy link
Contributor

@bors bors commented on 85e2bee Jul 9, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging kwantam/rust/master = 85e2bee into auto

@bors
Copy link
Contributor

@bors bors commented on 85e2bee Jul 9, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kwantam/rust/master = 85e2bee merged ok, testing candidate = fa7cbb5

@bors
Copy link
Contributor

@bors bors commented on 85e2bee Jul 9, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = fa7cbb5

Please sign in to comment.