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

Unified Diff: mojom/mojom_parser/parser/parse_driver_test.go

Issue 1423533003: Gives MojomFile a slice in order to store its imports in a specified order. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Improves comment. Created 5 years, 2 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
« no previous file with comments | « mojom/mojom_parser/parser/parse_driver.go ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojom/mojom_parser/parser/parse_driver_test.go
diff --git a/mojom/mojom_parser/parser/parse_driver_test.go b/mojom/mojom_parser/parser/parse_driver_test.go
index 9ddcec1ca2b4a00ed0dbdb479642967f8fb960eb..b4880ede80f0beaa02f7f34caf8d4d52718ca0d9 100644
--- a/mojom/mojom_parser/parser/parse_driver_test.go
+++ b/mojom/mojom_parser/parser/parse_driver_test.go
@@ -17,7 +17,7 @@ type FakeFileProvider struct {
}
// FakeFileProvider implements provideContents by recording the name of the file
-// whose contents are being requested.
+// whose contents are being requested and then returning the empty string.
func (f *FakeFileProvider) provideContents(fileRef *FileReference) (contents string, fileReadError error) {
f.requestedFileNames = append(f.requestedFileNames, fileRef.specifiedPath)
return "", nil
@@ -60,7 +60,7 @@ func (f *FakeFileExtractor) appendImportsToFile(fileName string, imports ...stri
// in the map |importNames|.
func (f *FakeFileExtractor) extractMojomFile(parser *Parser) *mojom.MojomFile {
file := parser.GetMojomFile()
- for _, importName := range f.importNames[file.FileName] {
+ for _, importName := range f.importNames[file.CanonicalFileName] {
file.AddImport(importName)
}
return file
@@ -74,7 +74,7 @@ func TestExpectedFilesParsed(t *testing.T) {
fakeFileExtractor := makeFakeFileExtractor()
// Our fake file1 will import file3, file4, file5
fakeFileExtractor.appendImportsToFile("file1", "file3", "file4", "file5")
- // Our fake file5 will import file1 and file5
+ // Our fake file5 will import file1 and file6
fakeFileExtractor.appendImportsToFile("file5", "file1", "file6")
// Construct the driver under test
« no previous file with comments | « mojom/mojom_parser/parser/parse_driver.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698