Merge pull request #106 from laraoz/parseRFC3659ListLine-issue
parseRFC3659ListLine issue
This commit is contained in:
		
						commit
						299b7ff5b6
					
				
							
								
								
									
										2
									
								
								parse.go
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								parse.go
									
									
									
									
									
								
							@ -40,7 +40,7 @@ func parseRFC3659ListLine(line string) (*Entry, error) {
 | 
				
			|||||||
			return nil, errUnsupportedListLine
 | 
								return nil, errUnsupportedListLine
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		key := field[:i]
 | 
							key := strings.ToLower(field[:i])
 | 
				
			||||||
		value := field[i+1:]
 | 
							value := field[i+1:]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		switch key {
 | 
							switch key {
 | 
				
			||||||
 | 
				
			|||||||
@ -47,6 +47,8 @@ var listTests = []line{
 | 
				
			|||||||
	{"modify=20150806235817;perm=fle;type=dir;unique=1B20F360U4;UNIX.group=0;UNIX.mode=0755;UNIX.owner=0; movies", "movies", 0, EntryTypeFolder, time.Date(2015, time.August, 6, 23, 58, 17, 0, time.UTC)},
 | 
						{"modify=20150806235817;perm=fle;type=dir;unique=1B20F360U4;UNIX.group=0;UNIX.mode=0755;UNIX.owner=0; movies", "movies", 0, EntryTypeFolder, time.Date(2015, time.August, 6, 23, 58, 17, 0, time.UTC)},
 | 
				
			||||||
	{"modify=20150814172949;perm=flcdmpe;type=dir;unique=85A0C168U4;UNIX.group=0;UNIX.mode=0777;UNIX.owner=0; _upload", "_upload", 0, EntryTypeFolder, time.Date(2015, time.August, 14, 17, 29, 49, 0, time.UTC)},
 | 
						{"modify=20150814172949;perm=flcdmpe;type=dir;unique=85A0C168U4;UNIX.group=0;UNIX.mode=0777;UNIX.owner=0; _upload", "_upload", 0, EntryTypeFolder, time.Date(2015, time.August, 14, 17, 29, 49, 0, time.UTC)},
 | 
				
			||||||
	{"modify=20150813175250;perm=adfr;size=951;type=file;unique=119FBB87UE;UNIX.group=0;UNIX.mode=0644;UNIX.owner=0; welcome.msg", "welcome.msg", 951, EntryTypeFile, time.Date(2015, time.August, 13, 17, 52, 50, 0, time.UTC)},
 | 
						{"modify=20150813175250;perm=adfr;size=951;type=file;unique=119FBB87UE;UNIX.group=0;UNIX.mode=0644;UNIX.owner=0; welcome.msg", "welcome.msg", 951, EntryTypeFile, time.Date(2015, time.August, 13, 17, 52, 50, 0, time.UTC)},
 | 
				
			||||||
 | 
						// Format and types have first letter UpperCase
 | 
				
			||||||
 | 
						{"Modify=20150813175250;Perm=adfr;Size=951;Type=file;Unique=119FBB87UE;UNIX.group=0;UNIX.mode=0644;UNIX.owner=0; welcome.msg", "welcome.msg", 951, EntryTypeFile, time.Date(2015, time.August, 13, 17, 52, 50, 0, time.UTC)},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// DOS DIR command output
 | 
						// DOS DIR command output
 | 
				
			||||||
	{"08-07-15  07:50PM                  718 Post_PRR_20150901_1166_265118_13049.dat", "Post_PRR_20150901_1166_265118_13049.dat", 718, EntryTypeFile, time.Date(2015, time.August, 7, 19, 50, 0, 0, time.UTC)},
 | 
						{"08-07-15  07:50PM                  718 Post_PRR_20150901_1166_265118_13049.dat", "Post_PRR_20150901_1166_265118_13049.dat", 718, EntryTypeFile, time.Date(2015, time.August, 7, 19, 50, 0, 0, time.UTC)},
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user