Changeset 3 in code
- Timestamp:
- Dec 5, 2014, 5:09:10 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zs.go
r1 r3 33 33 func md(s string) (map[string]string, string) { 34 34 v := map[string]string{} 35 // FIXME: if no header? 35 if strings.Index(s, "\n\n") == -1 { 36 return map[string]string{}, s 37 } 36 38 header, body := split2(s, "\n\n") 37 39 for _, line := range strings.Split(header, "\n") { -
trunk/zs_test.go
r2 r3 47 47 t.Error(body) 48 48 } 49 50 // Test empty md 51 v, body = md("") 52 if len(v) != 0 || len(body) != 0 { 53 t.Error(v, body) 54 } 55 56 // Test empty header 57 v, body = md("Hello") 58 if len(v) != 0 || body != "Hello" { 59 t.Error(v, body) 60 } 49 61 } 50 62
Note:
See TracChangeset
for help on using the changeset viewer.