|
it('should work on adding a struct to a struct', () => { |
|
const input = ` |
|
.Struct1 = [ |
|
.A=0 |
|
.B=2 |
|
] |
|
.Struct2 = [ |
|
.A=1 |
|
.C=3 |
|
] |
|
.MyVar = .Struct1 + .Struct2 |
|
`; |
|
const struct1ADefinition: VariableDefinition = { id: 1, range: createRange(2, 20, 22), name: 'A' }; |
|
const struct1BDefinition: VariableDefinition = { id: 2, range: createRange(3, 20, 22), name: 'B' }; |
|
const struct1 = Struct.from(Object.entries({ |
|
A: new StructMember(0, [struct1ADefinition]), |
|
B: new StructMember(2, [struct1BDefinition]), |
|
})); |
|
const struct2ADefinition: VariableDefinition = { id: 4, range: createRange(6, 20, 22), name: 'A' }; |
|
const struct2CDefinition: VariableDefinition = { id: 5, range: createRange(7, 20, 22), name: 'C' }; |
|
const struct2 = Struct.from(Object.entries({ |
|
A: new StructMember(1, [struct2ADefinition]), |
|
C: new StructMember(3, [struct2CDefinition]), |
|
})); |
|
assertEvaluatedVariablesValueEqual(input, [ |
|
0, |
|
2, |
|
struct1, |
|
1, |
|
3, |
|
struct2, |
|
struct1, |
|
struct2, |
|
Struct.from(Object.entries({ |
|
A: new StructMember(1, [struct2ADefinition]), |
|
B: new StructMember(2, [struct1BDefinition]), |
|
C: new StructMember(3, [struct2CDefinition]), |
|
})) |
|
]); |
|
}); |
Repro:
Actual
.Cresult:Expected
.Cresult:FASTBuild docs for adding structs
Problematic test case:
fastbuild-vscode/server/src/test/2-evaluator.test.ts
Lines 1235 to 1274 in b2c66c2