Skip to content

Commit

Permalink
add test that triggers the bug(issue#65) and fails
Browse files Browse the repository at this point in the history
  • Loading branch information
KevRiver authored and aybabtme committed Oct 25, 2024
1 parent d7c332e commit e46b27b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
24 changes: 24 additions & 0 deletions cmd/humanlog/main_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package main

import (
"os"
"strings"
"testing"
)

func TestApplyConfigFromConfigFile_when_one_of_skip_or_keep_is_given(t *testing.T) {

wd, _ := os.Getwd()
dirs := strings.Split(wd, "/")
root := strings.Join(dirs[:len(dirs)-2], "/")
configFilePath := root + "/test/cases/00065-apply-config/config.json"
t.Logf("config file path: %v", configFilePath)

args := []string{"program-path"}
args = append(args, "--config", configFilePath)

app := newApp()
if err := app.Run(args); err != nil {
t.Fatal(err)
}
}
3 changes: 3 additions & 0 deletions test/cases/00065-apply-config/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"skip": ["foo", "bar"]
}

0 comments on commit e46b27b

Please sign in to comment.