Skip to content

Commit

Permalink
fix: テストの引数を間違えていました
Browse files Browse the repository at this point in the history
  • Loading branch information
xztaityozx committed Nov 6, 2023
1 parent 242ea9a commit 28decc8
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion internal/column/index_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func TestIndexSelector_Select(t *testing.T) {
var buf []byte
w := bytes.NewBuffer(buf)

writer := output.NewWriter(option.Option{DelimiterOption: option.DelimiterOption{InputDelimiter: " "}}, w, false)
writer := output.NewWriter(option.Option{DelimiterOption: option.DelimiterOption{OutPutDelimiter: " "}}, w, false)

err := is.Select(writer, iterator.NewIterator(strings.Join(cols, " "), " ", false))

Expand Down
6 changes: 3 additions & 3 deletions internal/column/range_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func TestRangeSelector_Select(t *testing.T) {
for _, v := range dataset {
rs := NewRangeSelector(v.start, v.step, v.stop, false)
expect := expectFactory(v.expects)
writer := output.NewWriter(option.Option{DelimiterOption: option.DelimiterOption{InputDelimiter: " "}}, w, true)
writer := output.NewWriter(option.Option{DelimiterOption: option.DelimiterOption{OutPutDelimiter: " "}}, w, true)
err := rs.Select(writer, &testEnumerable{a: cols})
assert.Nil(t, writer.Flush())
assert.Nil(t, err)
Expand All @@ -83,7 +83,7 @@ func TestRangeSelector_Select(t *testing.T) {

for _, v := range dataset {
rs := NewRangeSelector(v.start, v.step, v.stop, false)
writer := output.NewWriter(option.Option{DelimiterOption: option.DelimiterOption{InputDelimiter: " "}}, w, true)
writer := output.NewWriter(option.Option{DelimiterOption: option.DelimiterOption{OutPutDelimiter: " "}}, w, true)
err := rs.Select(writer, &testEnumerable{a: cols})
assert.Nil(t, writer.Flush())
assert.NotNil(t, err)
Expand All @@ -94,7 +94,7 @@ func TestRangeSelector_Select(t *testing.T) {

t.Run("Inf", func(t *testing.T) {
rs := NewRangeSelector(1, 1, 1, true)
writer := output.NewWriter(option.Option{DelimiterOption: option.DelimiterOption{InputDelimiter: " "}}, w, true)
writer := output.NewWriter(option.Option{DelimiterOption: option.DelimiterOption{OutPutDelimiter: " "}}, w, true)
err := rs.Select(writer, &testEnumerable{a: cols})
assert.Nil(t, writer.Flush())
assert.Nil(t, err)
Expand Down
16 changes: 8 additions & 8 deletions internal/column/switch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func TestSwitchSelector_Select(t *testing.T) {
begin: address{num: 1},
end: endAddress{address: address{num: 5}},
},
args: args{iter: &testEnumerable{a: cols}, w: output.NewWriter(option.Option{DelimiterOption: option.DelimiterOption{InputDelimiter: " "}}, w, true)},
args: args{iter: &testEnumerable{a: cols}, w: output.NewWriter(option.Option{DelimiterOption: option.DelimiterOption{OutPutDelimiter: " "}}, w, true)},
want: cols[0:5],
},
{
Expand All @@ -109,7 +109,7 @@ func TestSwitchSelector_Select(t *testing.T) {
begin: address{regexp: regexp.MustCompile(`a`)},
end: endAddress{address{regexp: regexp.MustCompile(`e`)}, false},
},
args: args{iter: &testEnumerable{a: []string{"1", "2", "a", "b", "c", "d", "e", "3", "4"}}, w: output.NewWriter(option.Option{DelimiterOption: option.DelimiterOption{InputDelimiter: " "}}, w, true)},
args: args{iter: &testEnumerable{a: []string{"1", "2", "a", "b", "c", "d", "e", "3", "4"}}, w: output.NewWriter(option.Option{DelimiterOption: option.DelimiterOption{OutPutDelimiter: " "}}, w, true)},
want: []string{"a", "b", "c", "d", "e"},
},
{
Expand All @@ -118,7 +118,7 @@ func TestSwitchSelector_Select(t *testing.T) {
begin: address{regexp: regexp.MustCompile(`a`)},
end: endAddress{address{num: 5}, true},
},
args: args{iter: &testEnumerable{a: []string{"1", "2", "a", "b", "c", "d", "e", "3", "4"}}, w: output.NewWriter(option.Option{DelimiterOption: option.DelimiterOption{InputDelimiter: " "}}, w, true)},
args: args{iter: &testEnumerable{a: []string{"1", "2", "a", "b", "c", "d", "e", "3", "4"}}, w: output.NewWriter(option.Option{DelimiterOption: option.DelimiterOption{OutPutDelimiter: " "}}, w, true)},
want: []string{"a", "b", "c", "d", "e", "3"},
},
{
Expand All @@ -127,7 +127,7 @@ func TestSwitchSelector_Select(t *testing.T) {
begin: address{regexp: regexp.MustCompile(`e`)},
end: endAddress{address{num: -5}, true},
},
args: args{iter: &testEnumerable{a: []string{"1", "2", "a", "b", "c", "d", "e", "3", "4"}}, w: output.NewWriter(option.Option{DelimiterOption: option.DelimiterOption{InputDelimiter: " "}}, w, true)},
args: args{iter: &testEnumerable{a: []string{"1", "2", "a", "b", "c", "d", "e", "3", "4"}}, w: output.NewWriter(option.Option{DelimiterOption: option.DelimiterOption{OutPutDelimiter: " "}}, w, true)},
want: []string{"2", "a", "b", "c", "d", "e"},
},
{
Expand All @@ -136,7 +136,7 @@ func TestSwitchSelector_Select(t *testing.T) {
begin: address{regexp: regexp.MustCompile(`a`)},
end: endAddress{address{num: -5}, true},
},
args: args{iter: &testEnumerable{a: []string{"1", "2", "a", "b", "c", "d", "e", "3", "4"}}, w: output.NewWriter(option.Option{DelimiterOption: option.DelimiterOption{InputDelimiter: " "}}, w, true)},
args: args{iter: &testEnumerable{a: []string{"1", "2", "a", "b", "c", "d", "e", "3", "4"}}, w: output.NewWriter(option.Option{DelimiterOption: option.DelimiterOption{OutPutDelimiter: " "}}, w, true)},
want: []string{"1", "2", "a"},
},
{
Expand All @@ -145,7 +145,7 @@ func TestSwitchSelector_Select(t *testing.T) {
begin: address{regexp: regexp.MustCompile(`e`)},
end: endAddress{address{num: 5}, true},
},
args: args{iter: &testEnumerable{a: []string{"1", "2", "a", "b", "c", "d", "e", "3", "4"}}, w: output.NewWriter(option.Option{DelimiterOption: option.DelimiterOption{InputDelimiter: " "}}, w, true)},
args: args{iter: &testEnumerable{a: []string{"1", "2", "a", "b", "c", "d", "e", "3", "4"}}, w: output.NewWriter(option.Option{DelimiterOption: option.DelimiterOption{OutPutDelimiter: " "}}, w, true)},
want: []string{"e", "3", "4"},
},
{
Expand All @@ -154,7 +154,7 @@ func TestSwitchSelector_Select(t *testing.T) {
begin: address{regexp: regexp.MustCompile(`e`)},
end: endAddress{address{num: 0}, true},
},
args: args{iter: &testEnumerable{a: []string{"1", "2", "a", "b", "c", "d", "e", "3", "4"}}, w: output.NewWriter(option.Option{DelimiterOption: option.DelimiterOption{InputDelimiter: " "}}, w, true)},
args: args{iter: &testEnumerable{a: []string{"1", "2", "a", "b", "c", "d", "e", "3", "4"}}, w: output.NewWriter(option.Option{DelimiterOption: option.DelimiterOption{OutPutDelimiter: " "}}, w, true)},
want: []string{"e"},
},
{
Expand All @@ -163,7 +163,7 @@ func TestSwitchSelector_Select(t *testing.T) {
begin: address{regexp: regexp.MustCompile(`e`)},
end: endAddress{address{num: 0}, false},
},
args: args{iter: &testEnumerable{a: []string{"1", "2", "a", "b", "c", "d", "e", "3", "4"}}, w: output.NewWriter(option.Option{DelimiterOption: option.DelimiterOption{InputDelimiter: " "}}, w, true)},
args: args{iter: &testEnumerable{a: []string{"1", "2", "a", "b", "c", "d", "e", "3", "4"}}, w: output.NewWriter(option.Option{DelimiterOption: option.DelimiterOption{OutPutDelimiter: " "}}, w, true)},
want: []string{"e", "3", "4"},
},
}
Expand Down
2 changes: 1 addition & 1 deletion internal/output/writer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func TestNewWriter(t *testing.T) {

actual := NewWriter(option.Option{
DelimiterOption: option.DelimiterOption{
InputDelimiter: delim,
OutPutDelimiter: delim,
},
}, w, true)

Expand Down

0 comments on commit 28decc8

Please sign in to comment.