<commit_before>package cli

import (
	"testing"
	"github.com/gruntwork-io/terragrunt/options"
	"github.com/stretchr/testify/assert"
	"github.com/gruntwork-io/terragrunt/errors"
	"github.com/gruntwork-io/terragrunt/config"
	"os"
)

func TestParseTerragruntOptionsFromArgs(t *testing.T) {
	t.Parallel()

	workingDir, err := os.Getwd()
	if err != nil {
		t.Fatal(err)
	}

	testCases := []struct {
		args 		[]string
		expectedOptions *options.TerragruntOptions
		expectedErr     error
	}{
		{
			[]string{},
			mockOptions(config.DefaultTerragruntConfigPath, workingDir, []string{}, false),
			nil,
		},

		{
			[]string{"foo", "bar"},
			mockOptions(config.DefaultTerragruntConfigPath, workingDir, []string{"foo", "bar"}, false),
			nil,
		},

		{
			[]string{"--foo", "--bar"},
			mockOptions(config.DefaultTerragruntConfigPath, workingDir, []string{"--foo", "--bar"}, false),
			nil,
		},

		{
			[]string{"--foo", "apply", "--bar"},
			mockOptions(config.DefaultTerragruntConfigPath, workingDir, []string{"--foo", "apply", "--bar"}, false),
			nil,
		},

		{
			[]string{"--terragrunt-non-interactive"},
			mockOptions(config.DefaultTerragruntConfigPath, workingDir, []string{}, true),
			nil,
		},

		{
			[]string{"--terragrunt-config", "/some/path/.terragrunt"},
			mockOptions("/some/path/.terragrunt", workingDir, []string{}, false),
			nil,
		},

		{
			[]string{"--terragrunt-working-dir", "/some/path"},
			mockOptions(config.DefaultTerragruntConfigPath, "/some/path", []string{}, false),
			nil,<commit_msg>Fix TestParseTerragruntOptionsFromArgs<commit_after>package cli

import (
	"testing"
	"github.com/gruntwork-io/terragrunt/options"
	"github.com/stretchr/testify/assert"
	"github.com/gruntwork-io/terragrunt/errors"
	"github.com/gruntwork-io/terragrunt/config"
	"os"
	"path/filepath"
)

func TestParseTerragruntOptionsFromArgs(t *testing.T) {
	t.Parallel()

	workingDir, err := os.Getwd()
	if err != nil {
		t.Fatal(err)
	}

	testCases := []struct {
		args 		[]string
		expectedOptions *options.TerragruntOptions
		expectedErr     error
	}{
		{
			[]string{},
			mockOptions(filepath.Join(workingDir, config.DefaultTerragruntConfigPath), workingDir, []string{}, false),
			nil,
		},

		{
			[]string{"foo", "bar"},
			mockOptions(filepath.Join(workingDir, config.DefaultTerragruntConfigPath), workingDir, []string{"foo", "bar"}, false),
			nil,
		},

		{
			[]string{"--foo", "--bar"},
			mockOptions(filepath.Join(workingDir, config.DefaultTerragruntConfigPath), workingDir, []string{"--foo", "--bar"}, false),
			nil,
		},

		{
			[]string{"--foo", "apply", "--bar"},
			mockOptions(filepath.Join(workingDir, config.DefaultTerragruntConfigPath), workingDir, []string{"--foo", "apply", "--bar"}, false),
			nil,
		},

		{
			[]string{"--terragrunt-non-interactive"},
			mockOptions(filepath.Join(workingDir, config.DefaultTerragruntConfigPath), workingDir, []string{}, true),
			nil,
		},

		{
			[]string{"--terragrunt-config", "/some/path/.terragrunt"},
			mockOptions("/some/path/.terragrunt", workingDir, []string{}, false),
			nil,
		},

		{
			[]string{"--terragrunt-working-dir", "/some/path"},
			mockOptions(filepath.Join("/some/path", config.DefaultTerragruntConfigPath), "/some/path", []string{}, false),
			nil,
{'fraction_non_alphanumeric': 0.19240271772699197, 'fraction_numerical': 0.0, 'mean_word_length': 4.301145662847791, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7082033', 'n_tokens_mistral': 1291, 'n_tokens_neox': 1173, 'n_words': 167}