package stressql

import (
	"fmt"
	"os"
	"testing"
)

// Pulls the default configFile and makes sure it parses
func TestParseStatements(t *testing.T) {
	gopath := os.Getenv("GOPATH")
	if gopath == "" {
		t.Error("$GOPATH not set")
	}
	stmts, err := ParseStatements(fmt.Sprintf("%v/src/github.com/influxdata/influxdb/stress/v2/file.iql", gopath))
	if err != nil {
		t.Error(err)
	}
	expected := 15
	got := len(stmts)
	if expected != got {
		t.Errorf("expected: %v\ngot: %v\n", expected, got)
	}
}

package stressql

import "testing"

// Pulls the default configFile and makes sure it parses
func TestParseStatements(t *testing.T) {
	stmts, err := ParseStatements("../file.iql")
	if err != nil {
		t.Error(err)
	}
	expected := 15
	got := len(stmts)
	if expected != got {
		t.Errorf("expected: %v\ngot: %v\n", expected, got)
	}
}

Correct stress/v2 tests to not depend on $GOPATH
Correct stress/v2 tests to not depend on $GOPATH

The test assumed that you were working within a single directory
$GOPATH. `go test` actually sets the current directory to the directory
of the package being tested, so the relative path to the test file could
be used instead.
