Skip to content

Commit 1654e7a

Browse files
committed
fix: fix tests for all features turned off
1 parent 8e1dfcd commit 1654e7a

File tree

4 files changed

+12
-13
lines changed

4 files changed

+12
-13
lines changed

bindings/java/bin/bindings.zip

-217 Bytes
Binary file not shown.

bindings/wasm/bin/decancer.wasm

-25 Bytes
Binary file not shown.

core/src/similar.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,7 @@ impl Iterator for Matcher<'_, '_> {
180180
match self.other_iterator.next() {
181181
Some(new) => {
182182
current_other = new;
183-
184-
if current_other.1.is_none() {
185-
completed = true;
186-
}
183+
completed = current_other.1.is_none();
187184
},
188185

189186
None => return Some(self.start_index..last_match_end),
@@ -196,9 +193,7 @@ impl Iterator for Matcher<'_, '_> {
196193
self.self_index += matched_skip;
197194
last_match_end = self.self_index;
198195

199-
if current_other.1.is_none() {
200-
completed = true;
201-
}
196+
completed = current_other.1.is_none();
202197

203198
#[cfg(feature = "separators")]
204199
{

core/src/tests.rs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,27 +48,31 @@ fn similar_equal() {
4848

4949
assert_matches!("hello", "hello", [0..5]);
5050
assert_matches!("hhheeeeelllloo", "hello", [0..14]);
51-
assert_matches!("hh-he e eeell/l/lo//o", "hello", [0..22]);
52-
assert_matches!(" shhhiii/iiiiitttttt/ttttt ", "shit", [1..26]);
53-
assert_matches!("hh-he e eeell/l/lo-?", "hello", [0..19]);
5451
assert_matches!("?asdf-hhheeeeelllloo", "hello", [6..20]);
5552

5653
assert_matches!("-hello", "hello", [1..6]);
5754
assert_matches!("hello-", "hello", [0..5]);
5855
assert_matches!("---hello", "hello", [3..8]);
5956
assert_matches!("---hello-", "hello", [3..8]);
60-
assert_matches!("shhhiii/iiiiitttttt/ttttt/", "shit", [0..25]);
6157

6258
assert_matches!("hhheeeeelllloo!!", "hello", [0..14]);
63-
assert_matches!("hh-he e ee,e ll/l/lo//o-?", "hello", [0..24]);
6459

6560
assert_matches!("-!?hel$2-hello?", "hello", [9..14]);
6661
assert_matches!("-!?hel$2-hhheeeeelllloo!!", "hello", [9..23]);
67-
assert_matches!("-!?hel$2-hh-he e ee,e,ll/l/lo//o-?", "hello", [9..33]);
6862

6963
assert_matches!("wow hell wow heellllo", "hello", [14..22]);
7064
assert_matches!("wow hell wow heellllo!", "hello", [14..22]);
7165

66+
#[cfg(feature = "separators")]
67+
{
68+
assert_matches!("hh-he e eeell/l/lo//o", "hello", [0..22]);
69+
assert_matches!(" shhhiii/iiiiitttttt/ttttt ", "shit", [1..26]);
70+
assert_matches!("hh-he e eeell/l/lo-?", "hello", [0..19]);
71+
assert_matches!("shhhiii/iiiiitttttt/ttttt/", "shit", [0..25]);
72+
assert_matches!("hh-he e ee,e ll/l/lo//o-?", "hello", [0..24]);
73+
assert_matches!("-!?hel$2-hh-he e ee,e,ll/l/lo//o-?", "hello", [9..33]);
74+
}
75+
7276
#[cfg(feature = "leetspeak")]
7377
{
7478
assert_matches!("|-|3|_I_0", "hello", [0..9]);

0 commit comments

Comments
 (0)