package pkg

import (
	"os"
	"reflect"
	"testing"
)

func TestDefaultRunArgs(t *testing.T) {
	expected := RunArgs{
		Streams: Streams{
			Out: os.Stdout,
			In:  os.Stdin,
			Err: os.Stderr,
		},
		Argv: os.Args,

		Config: Config{
			RepoPath:                REPO_PATH,
			DocDir:                  DOC_DIR,
			TmpDir:                  TMP_DIR,
			ConfigDir:               CONFIG_DIR,
			Greylist:                GREYLIST,
			Blacklist:               BLACKLIST,
			DefaultPkgFile:          DEFAULT_PKG_FILE,
			SlackwareVersionFile:    SLACKWARE_VERSION_FILE,
			SlackpkgSystemConfigDir: SLACKPKG_SYSTEM_CONF_DIR,
			SlackpkgConfigDir:       SLACKPKG_CONF_DIR,
			SlackpkgSystemBlacklist: SLACKPKG_SYSTEM_BLACKLIST,
			PullCmd:                 PULL_CMD,
			SyncCmd:                 SYNC_CMD,
			CleanCmd:                CLEAN_CMD,
			SlackpkgCleanCmd:        SLACKPKG_CLEAN_CMD,
			DownloadCmd:             DOWNLOAD_CMD,
			InstallCmd:              INSTALL_CMD,
			FallbackPager:           FALLBACK_PAGER,
		},
	}

	if got := DefaultRunArgs(); !reflect.DeepEqual(got, expected) {
		t.Fatalf("DefaultRunArgs() = %#v, want %#v", got, expected)
	}
}
