From 88b4c29fb318cc0f455d6ebc3fb7865b00353a04 Mon Sep 17 00:00:00 2001 From: Dan Willemsen Date: Tue, 23 Jun 2015 19:45:56 -0700 Subject: [PATCH] Fix androidmk make_strings_test to use new API Change-Id: I23eb2df0603dbf76ff829c696cd09fe723efa9d9 --- androidmk/parser/make_strings_test.go | 53 ++++++++++++++------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/androidmk/parser/make_strings_test.go b/androidmk/parser/make_strings_test.go index db5840c63..cc3fd0a86 100644 --- a/androidmk/parser/make_strings_test.go +++ b/androidmk/parser/make_strings_test.go @@ -3,6 +3,7 @@ package parser import ( "strings" "testing" + "text/scanner" ) var splitNTestCases = []struct { @@ -13,61 +14,61 @@ var splitNTestCases = []struct { }{ { in: &MakeString{ - strings: []string{ + Strings: []string{ "a b c", "d e f", " h i j", }, - variables: []Variable{ - variable{name: SimpleMakeString("var1")}, - variable{name: SimpleMakeString("var2")}, + Variables: []Variable{ + Variable{Name: SimpleMakeString("var1", scanner.Position{})}, + Variable{Name: SimpleMakeString("var2", scanner.Position{})}, }, }, sep: " ", n: -1, expected: []*MakeString{ - SimpleMakeString("a"), - SimpleMakeString("b"), + SimpleMakeString("a", scanner.Position{}), + SimpleMakeString("b", scanner.Position{}), &MakeString{ - strings: []string{"c", "d"}, - variables: []Variable{ - variable{name: SimpleMakeString("var1")}, + Strings: []string{"c", "d"}, + Variables: []Variable{ + Variable{Name: SimpleMakeString("var1", scanner.Position{})}, }, }, - SimpleMakeString("e"), + SimpleMakeString("e", scanner.Position{}), &MakeString{ - strings: []string{"f", ""}, - variables: []Variable{ - variable{name: SimpleMakeString("var2")}, + Strings: []string{"f", ""}, + Variables: []Variable{ + Variable{Name: SimpleMakeString("var2", scanner.Position{})}, }, }, - SimpleMakeString("h"), - SimpleMakeString("i"), - SimpleMakeString("j"), + SimpleMakeString("h", scanner.Position{}), + SimpleMakeString("i", scanner.Position{}), + SimpleMakeString("j", scanner.Position{}), }, }, { in: &MakeString{ - strings: []string{ + Strings: []string{ "a b c", "d e f", " h i j", }, - variables: []Variable{ - variable{name: SimpleMakeString("var1")}, - variable{name: SimpleMakeString("var2")}, + Variables: []Variable{ + Variable{Name: SimpleMakeString("var1", scanner.Position{})}, + Variable{Name: SimpleMakeString("var2", scanner.Position{})}, }, }, sep: " ", n: 3, expected: []*MakeString{ - SimpleMakeString("a"), - SimpleMakeString("b"), + SimpleMakeString("a", scanner.Position{}), + SimpleMakeString("b", scanner.Position{}), &MakeString{ - strings: []string{"c", "d e f", " h i j"}, - variables: []Variable{ - variable{name: SimpleMakeString("var1")}, - variable{name: SimpleMakeString("var2")}, + Strings: []string{"c", "d e f", " h i j"}, + Variables: []Variable{ + Variable{Name: SimpleMakeString("var1", scanner.Position{})}, + Variable{Name: SimpleMakeString("var2", scanner.Position{})}, }, }, },