@@ -80,6 +80,7 @@ func TestReadPlainEnv(t *testing.T) {
80
80
"OPTION_E" : "5" ,
81
81
"OPTION_F" : "" ,
82
82
"OPTION_G" : "" ,
83
+ "OPTION_H" : "my string" ,
83
84
}
84
85
85
86
envMap , err := Read (envFileName )
@@ -350,7 +351,7 @@ func TestParsing(t *testing.T) {
350
351
// parses yaml style options
351
352
parseAndCompare (t , "OPTION_A: 1" , "OPTION_A" , "1" )
352
353
353
- //parses yaml values with equal signs
354
+ // parses yaml values with equal signs
354
355
parseAndCompare (t , "OPTION_A: Foo=bar" , "OPTION_A" , "Foo=bar" )
355
356
356
357
// parses non-yaml options with colons
@@ -399,7 +400,7 @@ func TestParsing(t *testing.T) {
399
400
parseAndCompare (t , `FOO="ba#r"` , "FOO" , "ba#r" )
400
401
parseAndCompare (t , "FOO='ba#r'" , "FOO" , "ba#r" )
401
402
402
- //newlines and backslashes should be escaped
403
+ // newlines and backslashes should be escaped
403
404
parseAndCompare (t , `FOO="bar\n\ b\az"` , "FOO" , "bar\n baz" )
404
405
parseAndCompare (t , `FOO="bar\\\n\ b\az"` , "FOO" , "bar\\ \n baz" )
405
406
parseAndCompare (t , `FOO="bar\\r\ b\az"` , "FOO" , "bar\\ r baz" )
@@ -483,14 +484,14 @@ func TestWrite(t *testing.T) {
483
484
t .Errorf ("Expected '%v' (%v) to write as '%v', got '%v' instead." , env , envMap , expected , actual )
484
485
}
485
486
}
486
- //just test some single lines to show the general idea
487
- //TestRoundtrip makes most of the good assertions
487
+ // just test some single lines to show the general idea
488
+ // TestRoundtrip makes most of the good assertions
488
489
489
- //values are always double-quoted
490
+ // values are always double-quoted
490
491
writeAndCompare (`key=value` , `key="value"` )
491
- //double-quotes are escaped
492
+ // double-quotes are escaped
492
493
writeAndCompare (`key=va"lu"e` , `key="va\"lu\"e"` )
493
- //but single quotes are left alone
494
+ // but single quotes are left alone
494
495
writeAndCompare (`key=va'lu'e` , `key="va'lu'e"` )
495
496
// newlines, backslashes, and some other special chars are escaped
496
497
writeAndCompare (`foo="\n\r\\r!"` , `foo="\n\r\\r\!"` )
0 commit comments