| Index: pkg/analyzer/test/src/task/model_test.dart
|
| diff --git a/pkg/analyzer/test/src/task/model_test.dart b/pkg/analyzer/test/src/task/model_test.dart
|
| index 5fd31ec70250b27e6fd7ffc6839a006a0d9507d6..9a402a291d9fc3117a1a0eeee0e1ecc4aade5e81 100644
|
| --- a/pkg/analyzer/test/src/task/model_test.dart
|
| +++ b/pkg/analyzer/test/src/task/model_test.dart
|
| @@ -19,6 +19,7 @@ main() {
|
| runReflectiveTests(AnalysisTaskTest);
|
| runReflectiveTests(ContributionPointImplTest);
|
| runReflectiveTests(ResultDescriptorImplTest);
|
| + runReflectiveTests(SimpleResultCachingPolicyTest);
|
| runReflectiveTests(TaskDescriptorImplTest);
|
| }
|
|
|
| @@ -94,6 +95,13 @@ class ContributionPointImplTest extends EngineTestCase {
|
|
|
| @reflectiveTest
|
| class ResultDescriptorImplTest extends EngineTestCase {
|
| + test_create_withCachingPolicy() {
|
| + ResultCachingPolicy policy = new SimpleResultCachingPolicy(128, 16);
|
| + ResultDescriptorImpl result =
|
| + new ResultDescriptorImpl('result', null, cachingPolicy: policy);
|
| + expect(result.cachingPolicy, same(policy));
|
| + }
|
| +
|
| test_create_withContribution() {
|
| CompositeResultDescriptorImpl point =
|
| new CompositeResultDescriptorImpl('point');
|
| @@ -104,6 +112,14 @@ class ResultDescriptorImplTest extends EngineTestCase {
|
| expect(contributors, unorderedEquals([result]));
|
| }
|
|
|
| + test_create_withoutCachingPolicy() {
|
| + ResultDescriptorImpl result = new ResultDescriptorImpl('result', null);
|
| + ResultCachingPolicy cachingPolicy = result.cachingPolicy;
|
| + expect(cachingPolicy, isNotNull);
|
| + expect(cachingPolicy.maxActiveSize, -1);
|
| + expect(cachingPolicy.maxIdleSize, -1);
|
| + }
|
| +
|
| test_create_withoutContribution() {
|
| expect(new ResultDescriptorImpl('name', null), isNotNull);
|
| }
|
| @@ -123,6 +139,16 @@ class ResultDescriptorImplTest extends EngineTestCase {
|
| }
|
|
|
| @reflectiveTest
|
| +class SimpleResultCachingPolicyTest extends EngineTestCase {
|
| + test_create() {
|
| + ResultCachingPolicy policy = new SimpleResultCachingPolicy(256, 32);
|
| + expect(policy.maxActiveSize, 256);
|
| + expect(policy.maxIdleSize, 32);
|
| + expect(policy.measure(null), 1);
|
| + }
|
| +}
|
| +
|
| +@reflectiveTest
|
| class TaskDescriptorImplTest extends EngineTestCase {
|
| test_create() {
|
| String name = 'name';
|
|
|