From e2d92a11047f0b9d7d4bae5788739b4e94a59b11 Mon Sep 17 00:00:00 2001 From: Derek Parker Date: Thu, 30 Jul 2015 12:11:10 -0500 Subject: [PATCH] Extract constant for breakpoint line in test --- proc/variables_test.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/proc/variables_test.go b/proc/variables_test.go index 74bbd24d..5736df12 100644 --- a/proc/variables_test.go +++ b/proc/variables_test.go @@ -29,6 +29,8 @@ func assertVariable(t *testing.T, variable *Variable, expected varTest) { } } +const varTestBreakpointLineNumber = 59 + func TestVariableEvaluation(t *testing.T) { testcases := []varTest{ {"a1", "foofoofoofoofoofoo", "struct string", nil}, @@ -70,7 +72,7 @@ func TestVariableEvaluation(t *testing.T) { } withTestProcess("testvariables", t, func(p *Process, fixture protest.Fixture) { - pc, _, _ := p.goSymTable.LineToPC(fixture.Source, 59) + pc, _, _ := p.goSymTable.LineToPC(fixture.Source, varTestBreakpointLineNumber) _, err := p.SetBreakpoint(pc) assertNoError(err, t, "SetBreakpoint() returned an error") @@ -94,7 +96,7 @@ func TestVariableEvaluation(t *testing.T) { func TestVariableFunctionScoping(t *testing.T) { withTestProcess("testvariables", t, func(p *Process, fixture protest.Fixture) { - pc, _, _ := p.goSymTable.LineToPC(fixture.Source, 59) + pc, _, _ := p.goSymTable.LineToPC(fixture.Source, varTestBreakpointLineNumber) _, err := p.SetBreakpoint(pc) assertNoError(err, t, "SetBreakpoint() returned an error") @@ -188,7 +190,7 @@ func TestLocalVariables(t *testing.T) { } withTestProcess("testvariables", t, func(p *Process, fixture protest.Fixture) { - pc, _, _ := p.goSymTable.LineToPC(fixture.Source, 59) + pc, _, _ := p.goSymTable.LineToPC(fixture.Source, varTestBreakpointLineNumber) _, err := p.SetBreakpoint(pc) assertNoError(err, t, "SetBreakpoint() returned an error")