~tomleb/arr

901919a0f843b2f213d3dcf43589c5bf7b16971f — Tom Lebreux 10 months ago f89bf3b master
Go fmt
2 files changed, 28 insertions(+), 28 deletions(-)

M encoding/decoding_test.go
M radarr/handlers/rarbg_test.go
M encoding/decoding_test.go => encoding/decoding_test.go +22 -22
@@ 21,11 21,11 @@ type foo struct {
	MaybeStr    *string    `arr:"maybe_str"`
	MaybeTime   *time.Time `arr:"maybe_time"`
	Time        time.Time  `arr:"time"`
	Baz         baz      `arr:"baz"`
	MaybeBaz    *baz     `arr:"maybe_baz"`
	Bool        bool     `arr:"bool"`
	List        []string `arr:"list"`
	ListWithSep []string `arr:"list" sep:"|"`
	Baz         baz        `arr:"baz"`
	MaybeBaz    *baz       `arr:"maybe_baz"`
	Bool        bool       `arr:"bool"`
	List        []string   `arr:"list"`
	ListWithSep []string   `arr:"list" sep:"|"`
}

func setEnv(envVars map[string]string) {


@@ 46,17 46,17 @@ func TestUnmarshal(t *testing.T) {
		{
			desc: "no_maybe",
			envVars: map[string]string{
				"str": "hello",
				"str":  "hello",
				"list": "a,b,c|d,e,f",
				"time": "8/2/2013 12:00:00 AM",
				"bool": "True",
				"baz": "my_value",
				"baz":  "my_value",
			},
			expected: foo{
				Str: "hello",
				Str:  "hello",
				Time: time.Date(2013, time.August, 2, 0, 0, 0, 0, time.UTC),
				Bool: true,
				Baz: baz("my_value"),
				Baz:  baz("my_value"),

				List:        []string{"a", "b", "c|d", "e", "f"},
				ListWithSep: []string{"a,b,c", "d,e,f"},


@@ 65,23 65,23 @@ func TestUnmarshal(t *testing.T) {
		{
			desc: "with_maybe",
			envVars: map[string]string{
				"str": "",
				"maybe_str": "my_maybe_str",
				"list": "a,b,c|d,e,f",
				"time": "8/2/2013 12:00:00 AM",
				"str":        "",
				"maybe_str":  "my_maybe_str",
				"list":       "a,b,c|d,e,f",
				"time":       "8/2/2013 12:00:00 AM",
				"maybe_time": "4/24/2019 04:45:31 PM",
				"bool": "True",
				"baz": "my_value",
				"maybe_baz": "maybe_value",
				"bool":       "True",
				"baz":        "my_value",
				"maybe_baz":  "maybe_value",
			},
			expected: foo{
				Str: "",
				MaybeStr: &maybeStr,
				Time: time.Date(2013, time.August, 2, 0, 0, 0, 0, time.UTC),
				Str:       "",
				MaybeStr:  &maybeStr,
				Time:      time.Date(2013, time.August, 2, 0, 0, 0, 0, time.UTC),
				MaybeTime: &maybeTime,
				Bool: true,
				Baz: baz("my_value"),
				MaybeBaz: &maybeBaz,
				Bool:      true,
				Baz:       baz("my_value"),
				MaybeBaz:  &maybeBaz,

				List:        []string{"a", "b", "c|d", "e", "f"},
				ListWithSep: []string{"a,b,c", "d,e,f"},

M radarr/handlers/rarbg_test.go => radarr/handlers/rarbg_test.go +6 -6
@@ 28,16 28,16 @@ func TestSubtitlePath(t *testing.T) {
		expected     string
	}{
		{
			lang: "English",
			lang:         "English",
			subtitlePath: "/download/2_English.srt",
			moviePath: "/movie/The.Movie.mp4",
			expected: "/movie/The.Movie.mp4.en.srt",
			moviePath:    "/movie/The.Movie.mp4",
			expected:     "/movie/The.Movie.mp4.en.srt",
		},
		{
			lang: "English",
			lang:         "English",
			subtitlePath: "/download/unknown.srt",
			moviePath: "/movie/The.Movie.mp4",
			expected: "/movie/The.Movie.mp4.unknown.srt",
			moviePath:    "/movie/The.Movie.mp4",
			expected:     "/movie/The.Movie.mp4.unknown.srt",
		},
	}