11package cmd
22
33import (
4- "runtime"
54 "testing"
65
76 "github.com/stretchr/testify/assert"
@@ -45,12 +44,11 @@ func TestAddAfterModification(t *testing.T) {
4544
4645func TestAddCommand (t * testing.T ) {
4746 for _ , tc := range []struct {
48- name string
49- skipOnWindows bool
50- args []string
51- add addCmdConfig
52- root interface {}
53- tests interface {}
47+ name string
48+ args []string
49+ add addCmdConfig
50+ root interface {}
51+ tests interface {}
5452 }{
5553 {
5654 name : "add_first_file" ,
@@ -90,9 +88,8 @@ func TestAddCommand(t *testing.T) {
9088 },
9189 },
9290 {
93- name : "add_recursive" ,
94- skipOnWindows : true ,
95- args : []string {"/home/user/.config" },
91+ name : "add_recursive" ,
92+ args : []string {"/home/user/.config" },
9693 add : addCmdConfig {
9794 recursive : true ,
9895 },
@@ -109,9 +106,8 @@ func TestAddCommand(t *testing.T) {
109106 },
110107 },
111108 {
112- name : "add_nested_directory" ,
113- skipOnWindows : true ,
114- args : []string {"/home/user/.config/micro/settings.json" },
109+ name : "add_nested_directory" ,
110+ args : []string {"/home/user/.config/micro/settings.json" },
115111 root : map [string ]interface {}{
116112 "/home/user" : & vfst.Dir {Perm : 0755 },
117113 "/home/user/.chezmoi" : & vfst.Dir {Perm : 0700 },
@@ -125,9 +121,8 @@ func TestAddCommand(t *testing.T) {
125121 },
126122 },
127123 {
128- name : "add_exact_dir" ,
129- skipOnWindows : true ,
130- args : []string {"/home/user/dir" },
124+ name : "add_exact_dir" ,
125+ args : []string {"/home/user/dir" },
131126 add : addCmdConfig {
132127 options : chezmoi.AddOptions {
133128 Exact : true ,
@@ -145,9 +140,8 @@ func TestAddCommand(t *testing.T) {
145140 },
146141 },
147142 {
148- name : "add_exact_dir_recursive" ,
149- skipOnWindows : true ,
150- args : []string {"/home/user/dir" },
143+ name : "add_exact_dir_recursive" ,
144+ args : []string {"/home/user/dir" },
151145 add : addCmdConfig {
152146 recursive : true ,
153147 options : chezmoi.AddOptions {
@@ -250,9 +244,8 @@ func TestAddCommand(t *testing.T) {
250244 },
251245 },
252246 {
253- name : "add_symlink_in_dir_recursive" ,
254- skipOnWindows : true ,
255- args : []string {"/home/user/foo" },
247+ name : "add_symlink_in_dir_recursive" ,
248+ args : []string {"/home/user/foo" },
256249 add : addCmdConfig {
257250 recursive : true ,
258251 },
@@ -272,9 +265,8 @@ func TestAddCommand(t *testing.T) {
272265 },
273266 },
274267 {
275- name : "add_symlink_with_parent_dir" ,
276- skipOnWindows : true ,
277- args : []string {"/home/user/foo/bar/baz" },
268+ name : "add_symlink_with_parent_dir" ,
269+ args : []string {"/home/user/foo/bar/baz" },
278270 root : map [string ]interface {}{
279271 "/home/user" : & vfst.Dir {Perm : 0755 },
280272 "/home/user/.chezmoi" : & vfst.Dir {Perm : 0700 },
@@ -313,9 +305,8 @@ func TestAddCommand(t *testing.T) {
313305 },
314306 },
315307 {
316- name : "dont_add_ignored_file_recursive" ,
317- skipOnWindows : true ,
318- args : []string {"/home/user/foo" },
308+ name : "dont_add_ignored_file_recursive" ,
309+ args : []string {"/home/user/foo" },
319310 add : addCmdConfig {
320311 recursive : true ,
321312 },
@@ -373,9 +364,6 @@ func TestAddCommand(t *testing.T) {
373364 },
374365 } {
375366 t .Run (tc .name , func (t * testing.T ) {
376- if runtime .GOOS == "windows" && tc .skipOnWindows {
377- t .Skip ("add --recursive is broken on windows" )
378- }
379367 c := & Config {
380368 SourceDir : "/home/user/.chezmoi" ,
381369 DestDir : "/home/user" ,
@@ -401,9 +389,6 @@ func TestAddCommand(t *testing.T) {
401389}
402390
403391func TestIssue192 (t * testing.T ) {
404- if runtime .GOOS == "windows" {
405- t .Skip ("add --recursive is broken on windows" )
406- }
407392 root := []interface {}{
408393 map [string ]interface {}{
409394 "/local/home/offbyone" : & vfst.Dir {
0 commit comments