Skip to content

Commit

Permalink
resync jsr166 tck tests for more scenarios
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-manes committed Mar 15, 2022
1 parent 003be23 commit 8d51164
Show file tree
Hide file tree
Showing 13 changed files with 4,211 additions and 744 deletions.
Expand Up @@ -2800,7 +2800,7 @@ public Set<Entry<K, V>> entrySet() {
* <p>
* The <i>consistency</i> property between invocations requires that the results are the same if
* there are no modifications to the information used. Therefore, usages should expect that this
* operation may return misleading results if either the map or the data held by them is modified
* operation may return misleading results if either map or the data held by them is modified
* during the execution of this method. This characteristic allows for comparing the map sizes and
* assuming stable mappings, as done by {@link AbstractMap}-based maps.
* <p>
Expand Down
@@ -1,15 +1,17 @@
/*
* Copyright 2022 Ben Manes. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.github.benmanes.caffeine.cache;

Expand Down
Expand Up @@ -28,6 +28,7 @@
import static com.google.common.collect.Maps.immutableEntry;
import static com.google.common.truth.Truth.assertThat;
import static java.util.Map.entry;
import static java.util.stream.Collectors.toMap;

import java.util.AbstractMap;
import java.util.ArrayList;
Expand Down Expand Up @@ -62,7 +63,6 @@
import com.github.benmanes.caffeine.testing.ConcurrentTestHarness;
import com.github.benmanes.caffeine.testing.Int;
import com.google.common.base.Splitter;
import com.google.common.collect.Maps;
import com.google.common.testing.SerializableTester;

/**
Expand Down Expand Up @@ -1559,7 +1559,8 @@ public void equals(Map<Int, Int> map, CacheContext context) {
assertThat(context.absent().equals(map)).isFalse();

if (!map.isEmpty()) {
var other = Maps.asMap(map.keySet(), CompletableFuture::completedFuture);
var other = map.entrySet().stream().collect(toMap(
entry -> entry.getKey(), entry -> entry.getValue().negate()));
assertThat(map.equals(other)).isFalse();
assertThat(other.equals(map)).isFalse();
}
Expand Down

0 comments on commit 8d51164

Please sign in to comment.