@@ -27,9 +27,10 @@ func TestCLIParsing(t *testing.T) {
2727 },
2828 wantErr : false ,
2929 expected : Config {
30- PostgresDSN : "postgres://user:pass@localhost:5432/db" ,
31- EtcdDSN : "etcd://localhost:2379/" ,
32- LogLevel : "info" , // default value
30+ PostgresDSN : "postgres://user:pass@localhost:5432/db" ,
31+ EtcdDSN : "etcd://localhost:2379/" ,
32+ LogLevel : "info" , // default value
33+ PollingInterval : "1s" , // default value
3334 },
3435 },
3536 {
@@ -40,27 +41,20 @@ func TestCLIParsing(t *testing.T) {
4041 },
4142 wantErr : false ,
4243 expected : Config {
43- PostgresDSN : "postgres://user:pass@localhost:5432/db" ,
44- EtcdDSN : "etcd://localhost:2379,localhost:2380,localhost:2381/" ,
45- LogLevel : "info" , // default value
46- },
47- },
48- {
49- name : "help flag" ,
50- args : []string {"--help" },
51- wantErr : false ,
52- expected : Config {
53- Help : true ,
54- LogLevel : "info" , // default value
44+ PostgresDSN : "postgres://user:pass@localhost:5432/db" ,
45+ EtcdDSN : "etcd://localhost:2379,localhost:2380,localhost:2381/" ,
46+ LogLevel : "info" , // default value
47+ PollingInterval : "1s" , // default value
5548 },
5649 },
5750 {
5851 name : "version flag" ,
5952 args : []string {"--version" },
6053 wantErr : false ,
6154 expected : Config {
62- Version : true ,
63- LogLevel : "info" , // default value
55+ Version : true ,
56+ LogLevel : "info" , // default value
57+ PollingInterval : "1s" , // default value
6458 },
6559 },
6660 {
@@ -71,12 +65,12 @@ func TestCLIParsing(t *testing.T) {
7165 "--log-level" , "debug" ,
7266 "--dry-run" ,
7367 },
74- wantErr : false ,
68+ wantErr : true , // dry-run not implemented
7569 expected : Config {
76- PostgresDSN : "postgres://user:pass@localhost:5432/db" ,
77- EtcdDSN : "etcd://localhost:2379/" ,
78- LogLevel : "debug" ,
79- DryRun : true ,
70+ PostgresDSN : "postgres://user:pass@localhost:5432/db" ,
71+ EtcdDSN : "etcd://localhost:2379/" ,
72+ LogLevel : "debug" ,
73+ PollingInterval : "1s" , // default value
8074 },
8175 },
8276 {
@@ -87,9 +81,10 @@ func TestCLIParsing(t *testing.T) {
8781 },
8882 wantErr : false ,
8983 expected : Config {
90- PostgresDSN : "postgres://user:pass@localhost:5432/db" ,
91- EtcdDSN : "etcd://localhost:2379/config/?tls=enabled&dial_timeout=5s" ,
92- LogLevel : "info" , // default value
84+ PostgresDSN : "postgres://user:pass@localhost:5432/db" ,
85+ EtcdDSN : "etcd://localhost:2379/config/?tls=enabled&dial_timeout=5s" ,
86+ LogLevel : "info" , // default value
87+ PollingInterval : "1s" , // default value
9388 },
9489 },
9590 {
@@ -101,9 +96,10 @@ func TestCLIParsing(t *testing.T) {
10196 },
10297 wantErr : false ,
10398 expected : Config {
104- PostgresDSN : "postgres://user:pass@localhost:5432/db" ,
105- EtcdDSN : "etcd://localhost:2379/" ,
106- LogLevel : "warn" ,
99+ PostgresDSN : "postgres://user:pass@localhost:5432/db" ,
100+ EtcdDSN : "etcd://localhost:2379/" ,
101+ LogLevel : "warn" ,
102+ PollingInterval : "1s" , // default value
107103 },
108104 },
109105 }
0 commit comments