(t *testing.T)
| 1150 | } |
| 1151 | |
| 1152 | func TestBodyRenameAttribute(t *testing.T) { |
| 1153 | tests := []struct { |
| 1154 | src string |
| 1155 | oldName string |
| 1156 | newName string |
| 1157 | want Tokens |
| 1158 | }{ |
| 1159 | { |
| 1160 | "", |
| 1161 | "a", |
| 1162 | "b", |
| 1163 | Tokens{ |
| 1164 | { |
| 1165 | Type: hclsyntax.TokenEOF, |
| 1166 | Bytes: []byte{}, |
| 1167 | SpacesBefore: 0, |
| 1168 | }, |
| 1169 | }, |
| 1170 | }, |
| 1171 | { |
| 1172 | "a = false\n", |
| 1173 | "a", |
| 1174 | "b", |
| 1175 | Tokens{ |
| 1176 | { |
| 1177 | Type: hclsyntax.TokenIdent, |
| 1178 | Bytes: []byte{'b'}, |
| 1179 | SpacesBefore: 0, |
| 1180 | }, |
| 1181 | { |
| 1182 | Type: hclsyntax.TokenEqual, |
| 1183 | Bytes: []byte{'='}, |
| 1184 | SpacesBefore: 1, |
| 1185 | }, |
| 1186 | { |
| 1187 | Type: hclsyntax.TokenIdent, |
| 1188 | Bytes: []byte("false"), |
| 1189 | SpacesBefore: 1, |
| 1190 | }, |
| 1191 | { |
| 1192 | Type: hclsyntax.TokenNewline, |
| 1193 | Bytes: []byte{'\n'}, |
| 1194 | SpacesBefore: 0, |
| 1195 | }, |
| 1196 | { |
| 1197 | Type: hclsyntax.TokenEOF, |
| 1198 | Bytes: []byte{}, |
| 1199 | SpacesBefore: 0, |
| 1200 | }, |
| 1201 | }, |
| 1202 | }, |
| 1203 | { |
| 1204 | "a = false\n", |
| 1205 | "b", |
| 1206 | "c", |
| 1207 | Tokens{ |
| 1208 | { |
| 1209 | Type: hclsyntax.TokenIdent, |
nothing calls this directly
no test coverage detected