Skip to content

Commit 3ec2c75

Browse files
committed
fix tests that need to know if we're on S2 or not
1 parent 0d21c36 commit 3ec2c75

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

pkg/demoinfocs/common/common_test.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,12 @@ func TestBombPosition(t *testing.T) {
2525
plEntity := entityWithID(1)
2626
plEntity.On("Position").Return(playerPos)
2727

28-
bomb.Carrier = &Player{Entity: plEntity}
28+
bomb.Carrier = &Player{
29+
Entity: plEntity,
30+
demoInfoProvider: demoInfoProviderMock{
31+
isSource2: false,
32+
},
33+
}
2934
assert.Equal(t, playerPos, bomb.Position(), "Bomb position should be Player.Position")
3035
}
3136

pkg/demoinfocs/game_events_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ import (
1717
// See #90
1818
func TestRoundEnd_LoserState_Score(t *testing.T) {
1919
p := NewParser(rand.Reader).(*parser)
20+
p.header = &common.DemoHeader{
21+
Filestamp: "HL2DEMO",
22+
}
2023

2124
p.gameState.tState.Entity = stfake.NewEntityWithProperty("m_scoreTotal", st.PropertyValue{IntVal: 1})
2225
p.gameState.ctState.Entity = stfake.NewEntityWithProperty("m_scoreTotal", st.PropertyValue{IntVal: 2})

0 commit comments

Comments
 (0)