Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Unified Diff: pkg/analysis_server/test/index/split_store_test.dart

Issue 347153002: Use single quotes for index store. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/analysis_server/test/index/split_store_test.dart
diff --git a/pkg/analysis_server/test/index/split_store_test.dart b/pkg/analysis_server/test/index/split_store_test.dart
index f78a6be5844b47754539554df11c900bf3359c1b..6155805447f8d4f5a33df0a05fb7e8557494a2f4 100644
--- a/pkg/analysis_server/test/index/split_store_test.dart
+++ b/pkg/analysis_server/test/index/split_store_test.dart
@@ -94,8 +94,8 @@ class _ElementCodecTest {
void test_localLocalVariable() {
{
Element element = new _MockElement();
- ElementLocation location = new ElementLocationImpl.con3(["main", "foo@1",
- "bar@2"]);
+ ElementLocation location = new ElementLocationImpl.con3(['main', 'foo@1',
+ 'bar@2']);
when(context.getElement(location)).thenReturn(element);
when(element.location).thenReturn(location);
int id = codec.encode(element);
@@ -103,8 +103,8 @@ class _ElementCodecTest {
}
{
Element element = new _MockElement();
- ElementLocation location = new ElementLocationImpl.con3(["main", "foo@10",
- "bar@20"]);
+ ElementLocation location = new ElementLocationImpl.con3(['main', 'foo@10',
+ 'bar@20']);
when(context.getElement(location)).thenReturn(element);
when(element.location).thenReturn(location);
int id = codec.encode(element);
@@ -120,8 +120,8 @@ class _ElementCodecTest {
void test_localVariable() {
{
Element element = new _MockElement();
- ElementLocation location = new ElementLocationImpl.con3(["main",
- "foo@42"]);
+ ElementLocation location = new ElementLocationImpl.con3(['main',
+ 'foo@42']);
when(context.getElement(location)).thenReturn(element);
when(element.location).thenReturn(location);
int id = codec.encode(element);
@@ -129,8 +129,8 @@ class _ElementCodecTest {
}
{
Element element = new _MockElement();
- ElementLocation location = new ElementLocationImpl.con3(["main",
- "foo@4200"]);
+ ElementLocation location = new ElementLocationImpl.con3(['main',
+ 'foo@4200']);
when(context.getElement(location)).thenReturn(element);
when(element.location).thenReturn(location);
int id = codec.encode(element);
@@ -144,7 +144,7 @@ class _ElementCodecTest {
void test_notLocal() {
Element element = new _MockElement();
- ElementLocation location = new ElementLocationImpl.con3(["foo", "bar"]);
+ ElementLocation location = new ElementLocationImpl.con3(['foo', 'bar']);
when(element.location).thenReturn(location);
when(context.getElement(location)).thenReturn(element);
int id = codec.encode(element);
@@ -189,7 +189,7 @@ class _FileNodeManagerTest {
}
void test_getNode_contextNull() {
- String name = "42.index";
+ String name = '42.index';
// record bytes
List<int> bytes;
when(fileManager.write(name, anyObject)).thenInvoke((name, bs) {
@@ -217,7 +217,7 @@ class _FileNodeManagerTest {
}
test_getNode_invalidVersion() {
- String name = "42.index";
+ String name = '42.index';
// prepare a stream with an invalid version
when(fileManager.read(name)).thenReturn(new Future.value([0x01, 0x02, 0x03,
0x04]));
@@ -231,7 +231,7 @@ class _FileNodeManagerTest {
}
test_getNode_streamException() {
- String name = "42.index";
+ String name = '42.index';
when(fileManager.read(name)).thenReturn(new Future(() {
return throw new Exception();
}));
@@ -244,7 +244,7 @@ class _FileNodeManagerTest {
}
test_getNode_streamNull() {
- String name = "42.index";
+ String name = '42.index';
when(fileManager.read(name)).thenReturn(new Future.value(null));
// do in the Future
return nodeManager.getNode(name).then((IndexNode node) {
@@ -261,7 +261,7 @@ class _FileNodeManagerTest {
}
test_putNode_getNode() {
- String name = "42.index";
+ String name = '42.index';
// record bytes
List<int> bytes;
when(fileManager.write(name, anyObject)).thenInvoke((name, bs) {
@@ -271,7 +271,7 @@ class _FileNodeManagerTest {
Element elementA = _mockElement();
Element elementB = _mockElement();
Element elementC = _mockElement();
- Relationship relationship = Relationship.getRelationship("my-relationship");
+ Relationship relationship = Relationship.getRelationship('my-relationship');
// put Node
Future putFuture;
{
@@ -316,7 +316,7 @@ class _FileNodeManagerTest {
}
test_putNode_streamException() {
- String name = "42.index";
+ String name = '42.index';
Exception exception = new Exception();
when(fileManager.write(name, anyObject)).thenReturn(new Future(() {
return throw exception;
@@ -334,7 +334,7 @@ class _FileNodeManagerTest {
}
void test_removeNode() {
- String name = "42.index";
+ String name = '42.index';
nodeManager.removeNode(name);
verify(fileManager.delete(name)).once();
}
@@ -371,7 +371,7 @@ class _IndexNodeTest {
Element elementA = _mockElement();
Element elementB = _mockElement();
Element elementC = _mockElement();
- Relationship relationship = Relationship.getRelationship("my-relationship");
+ Relationship relationship = Relationship.getRelationship('my-relationship');
Location locationA = new Location(elementB, 1, 2);
Location locationB = new Location(elementC, 10, 20);
// empty initially
@@ -402,7 +402,7 @@ class _IndexNodeTest {
Element elementA = _mockElement();
Element elementB = _mockElement();
Element elementC = _mockElement();
- Relationship relationship = Relationship.getRelationship("my-relationship");
+ Relationship relationship = Relationship.getRelationship('my-relationship');
// record
{
int elementIdA = 0;
@@ -736,13 +736,13 @@ class _RelationKeyDataTest {
int elementId = 2;
{
element = new _MockElement();
- ElementLocation location = new ElementLocationImpl.con3(["foo", "bar"]);
+ ElementLocation location = new ElementLocationImpl.con3(['foo', 'bar']);
when(element.location).thenReturn(location);
when(context.getElement(location)).thenReturn(element);
when(elementCodec.encode(element)).thenReturn(elementId);
}
// prepare relationship
- Relationship relationship = Relationship.getRelationship("my-relationship");
+ Relationship relationship = Relationship.getRelationship('my-relationship');
int relationshipId = 1;
when(relationshipCodec.encode(relationship)).thenReturn(relationshipId);
// create RelationKeyData
@@ -770,7 +770,7 @@ class _RelationshipCodecTest {
}
void test_all() {
- Relationship relationship = Relationship.getRelationship("my-relationship");
+ Relationship relationship = Relationship.getRelationship('my-relationship');
int id = codec.encode(relationship);
expect(codec.decode(id), relationship);
}
@@ -799,20 +799,20 @@ class _SplitIndexStoreTest {
Element elementC = new _MockElement('elementC');
Element elementD = new _MockElement('elementD');
ElementLocation elementLocationA = new ElementLocationImpl.con3(
- ["/home/user/sourceA.dart", "ClassA"]);
+ ['/home/user/sourceA.dart', 'ClassA']);
ElementLocation elementLocationB = new ElementLocationImpl.con3(
- ["/home/user/sourceB.dart", "ClassB"]);
+ ['/home/user/sourceB.dart', 'ClassB']);
ElementLocation elementLocationC = new ElementLocationImpl.con3(
- ["/home/user/sourceC.dart", "ClassC"]);
+ ['/home/user/sourceC.dart', 'ClassC']);
ElementLocation elementLocationD = new ElementLocationImpl.con3(
- ["/home/user/sourceD.dart", "ClassD"]);
+ ['/home/user/sourceD.dart', 'ClassD']);
HtmlElement htmlElementA = new _MockHtmlElement();
HtmlElement htmlElementB = new _MockHtmlElement();
LibraryElement libraryElement = new _MockLibraryElement();
Source librarySource = new _MockSource('librarySource');
CompilationUnitElement libraryUnitElement = new _MockCompilationUnitElement();
_MemoryNodeManager nodeManager = new _MemoryNodeManager();
- Relationship relationship = Relationship.getRelationship("test-relationship");
+ Relationship relationship = Relationship.getRelationship('test-relationship');
Source sourceA = new _MockSource('sourceA');
Source sourceB = new _MockSource('sourceB');
Source sourceC = new _MockSource('sourceC');
@@ -831,10 +831,10 @@ class _SplitIndexStoreTest {
when(contextA.getElement(elementLocationB)).thenReturn(elementB);
when(contextA.getElement(elementLocationC)).thenReturn(elementC);
when(contextA.getElement(elementLocationD)).thenReturn(elementD);
- when(sourceA.fullName).thenReturn("/home/user/sourceA.dart");
- when(sourceB.fullName).thenReturn("/home/user/sourceB.dart");
- when(sourceC.fullName).thenReturn("/home/user/sourceC.dart");
- when(sourceD.fullName).thenReturn("/home/user/sourceD.dart");
+ when(sourceA.fullName).thenReturn('/home/user/sourceA.dart');
+ when(sourceB.fullName).thenReturn('/home/user/sourceB.dart');
+ when(sourceC.fullName).thenReturn('/home/user/sourceC.dart');
+ when(sourceD.fullName).thenReturn('/home/user/sourceD.dart');
when(elementA.context).thenReturn(contextA);
when(elementB.context).thenReturn(contextA);
when(elementC.context).thenReturn(contextA);
@@ -1296,7 +1296,8 @@ class _SplitIndexStoreTest {
}
/**
- * Asserts that the "actual" locations have all the "expected" locations and only them.
+ * Asserts that the [actual] locations have all the [expected] locations and
+ * only them.
*/
static void assertLocations(List<Location> actual, List<Location> expected) {
List<_LocationEqualsWrapper> actualWrappers = wrapLocations(actual);

Powered by Google App Engine
This is Rietveld 408576698