Skip to content

Commit

Permalink
Linting and adding verbose, test
Browse files Browse the repository at this point in the history
  • Loading branch information
lovestaco committed Jul 20, 2023
1 parent ce1359c commit 251ddef
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
2 changes: 1 addition & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ gofumpt:

test:
make buildme
go test ./tests/ -count=1
go test ./tests/ -count=1 -v

benchmark:
go test -bench=. -count 1 -run=^# -benchmem ./tests/
Expand Down
15 changes: 6 additions & 9 deletions tests/env_command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@ package tests

import (
// "encoding/json"
"os/exec"
"testing"
"fmt"
"bytes"
"encoding/json"
"fmt"
"os/exec"
"testing"
)

type EnvData struct {
Src string `json:"src"`
Val string `json:"val"`
}

func runL2CommandAndParseJSON(t *testing.T, cmdArgs ...string) {
func runL2CommandAndParseJSON(t *testing.T, cmdArgs ...string) {
cmd := exec.Command("../build/l2", cmdArgs...)
var stdout bytes.Buffer
cmd.Stdout = &stdout
Expand Down Expand Up @@ -63,17 +63,14 @@ func runL2CommandAndParseJSON(t *testing.T, cmdArgs ...string) {
t.Errorf(`Expected "val" value to be "https://httpbin.org" for "BHOST", but got: %v`, bhost.Val)
}
}

}


func TestL2EnvCommand(t *testing.T) {
cmdArgs := []string{"-e", "../elfparser/ElfTestSuite/root_variable_override/api/y_0020_root_override.l2"}
runL2CommandAndParseJSON(t, cmdArgs...)
}


func TestL2EnvCommandVerbose(t *testing.T) {
cmdArgs := []string{"-ev", "../elfparser/ElfTestSuite/root_variable_override/api/y_0020_root_override.l2"}
runL2CommandAndParseJSON(t, cmdArgs...)
}
runL2CommandAndParseJSON(t, cmdArgs...)
}
4 changes: 2 additions & 2 deletions tests/multistage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ func TestMultiStageCount(t *testing.T) {
for _, block := range parsedAPIblocks {
blockType := block.S("type").Data().(string)
if blockType == "processor" {
procCount ++
procCount++
} else if blockType == "Lama2File" {
reqCount ++
reqCount++
}
}

Expand Down

0 comments on commit 251ddef

Please sign in to comment.