Skip to content

Commit

Permalink
remove generated files from test of main
Browse files Browse the repository at this point in the history
Signed-off-by: adisos <[email protected]>
  • Loading branch information
adisos committed Jan 11, 2024
1 parent 7aabf53 commit 7f51f65
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions cmd/analyzer/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
package main

import (
"errors"
"os"
"path/filepath"
"strings"
"testing"
)

// //////////////////////////////////
// this file need to be rewritten, no need to code review it
// ///////////////////////////////////////
func Test_main(t *testing.T) {
// TODO: this file need to be rewritten
func TestMain(t *testing.T) {
tests := []struct {
name string
args string
Expand All @@ -28,4 +29,18 @@ func Test_main(t *testing.T) {
}
})
}
removeGeneratedFiles()
}

func removeGeneratedFiles() {
files1, err1 := filepath.Glob("*.txt")
files2, err2 := filepath.Glob("*.drawio")
if err1 != nil || err2 != nil {
panic(errors.Join(err1, err2))
}
for _, f := range append(files1, files2...) {
if err := os.Remove(f); err != nil {
panic(err)
}
}
}

0 comments on commit 7f51f65

Please sign in to comment.