File tree Expand file tree Collapse file tree 2 files changed +21
-4
lines changed
com.oracle.truffle.regex.test/src/com/oracle/truffle/regex/tregex
com.oracle.truffle.regex/src/com/oracle/truffle/regex/util Expand file tree Collapse file tree 2 files changed +21
-4
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright (c) 2018, 2021 , Oracle and/or its affiliates. All rights reserved.
2
+ * Copyright (c) 2018, 2025 , Oracle and/or its affiliates. All rights reserved.
3
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
4
*
5
5
* The Universal Permissive License (UPL), Version 1.0
@@ -250,6 +250,23 @@ public void testSubtract() {
250
250
reset ();
251
251
}
252
252
253
+ @ Test
254
+ public void testEquals () {
255
+ TBitSet small = new TBitSet (128 );
256
+ TBitSet large = new TBitSet (256 );
257
+ Assert .assertTrue (small .equals (large ));
258
+ Assert .assertTrue (large .equals (small ));
259
+ small .set (42 );
260
+ Assert .assertFalse (small .equals (large ));
261
+ Assert .assertFalse (large .equals (small ));
262
+ large .set (42 );
263
+ Assert .assertTrue (small .equals (large ));
264
+ Assert .assertTrue (large .equals (small ));
265
+ large .set (211 );
266
+ Assert .assertFalse (small .equals (large ));
267
+ Assert .assertFalse (large .equals (small ));
268
+ }
269
+
253
270
private void checkSet (int i ) {
254
271
oracle .set (i );
255
272
bitSet .set (i );
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright (c) 2020, 2024 , Oracle and/or its affiliates. All rights reserved.
2
+ * Copyright (c) 2020, 2025 , Oracle and/or its affiliates. All rights reserved.
3
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
4
*
5
5
* The Universal Permissive License (UPL), Version 1.0
@@ -260,12 +260,12 @@ public static boolean equals(long[] bs1, long[] bs2) {
260
260
}
261
261
}
262
262
for (int i = bs1 .length ; i < bs2 .length ; i ++) {
263
- if (bs1 [i ] != 0 ) {
263
+ if (bs2 [i ] != 0 ) {
264
264
return false ;
265
265
}
266
266
}
267
267
for (int i = bs2 .length ; i < bs1 .length ; i ++) {
268
- if (bs2 [i ] != 0 ) {
268
+ if (bs1 [i ] != 0 ) {
269
269
return false ;
270
270
}
271
271
}
You can’t perform that action at this time.
0 commit comments