Codebase list golang-github-glacjay-goini / 5c1325ec-4c9f-48c8-8667-7f246db78360/main
[ Alexandre Viau ] [ Debian Janitor ] New upstream snapshot. Debian Janitor 2 years ago
3 changed file(s) with 28 addition(s) and 11 deletion(s). Raw diff Collapse all Expand all
0 golang-github-glacjay-goini (0.0~git20150730-3) UNRELEASED; urgency=medium
0 golang-github-glacjay-goini (0.0~git20161120-1) UNRELEASED; urgency=medium
11
2 [ Alexandre Viau ]
23 * Point Vcs-* urls to salsa.debian.org.
34
4 -- Alexandre Viau <aviau@debian.org> Mon, 02 Apr 2018 16:39:00 -0400
5 [ Debian Janitor ]
6 * New upstream snapshot.
7
8 -- Alexandre Viau <aviau@debian.org> Tue, 28 Sep 2021 06:10:29 -0000
59
610 golang-github-glacjay-goini (0.0~git20150730-2) unstable; urgency=medium
711
5050 break
5151 }
5252 lineno++
53 if len(l) == 0 {
53
54 line := strings.TrimFunc(string(l), unicode.IsSpace)
55 if len(line) == 0 {
5456 continue
5557 }
56 line := strings.TrimFunc(string(l), unicode.IsSpace)
57
58
5859 for line[len(line)-1] == '\\' {
5960 line = line[:len(line)-1]
6061 l, _, err := reader.ReadLine()
00 package ini
11
22 import (
3 "bufio"
34 "io/ioutil"
5 "os"
6 "strings"
47 "testing"
5 "strings"
6 "bufio"
78 )
89
910 var (
1819 func TestLoad(t *testing.T) {
1920 if err != nil {
2021 t.Error("Example: load error:", err)
22 }
23 }
24
25 func TestLoadFileWithSpaces(t *testing.T) {
26 if err := ioutil.WriteFile("testLoadFileWithSpaces.ini", []byte(" "), 0777); err != nil {
27 t.Error("Unable to write test file")
28 }
29 defer os.Remove("testLoadFileWithSpaces.ini")
30
31 if _, err := Load("testLoadFileWithSpaces.ini"); err != nil {
32 t.Error("Load: Couldn't load ini file with line consisting only of spaces.")
2133 }
2234 }
2335
161173 }
162174 s, found := d2.GetString("section1", "key1")
163175 if !found || s != "value2" {
164 t.Error("Stringify failed for section1, key1")
176 t.Error("Stringify failed for section1, key1")
165177 }
166178 i, found := d2.GetInt("section1", "key2")
167179 if !found || i != 5 {
168 t.Error("Stringify failed for section1, key2")
180 t.Error("Stringify failed for section1, key2")
169181 }
170182 db, found := d2.GetDouble("section1", "key3")
171183 if !found || db != 1.3 {
172 t.Error("Stringify failed for section1, key3")
184 t.Error("Stringify failed for section1, key3")
173185 }
174186 db, found = d2.GetDouble("section2", "key1")
175187 if !found || db != 5.0 {
176 t.Error("Stringify failed for section2, key1")
188 t.Error("Stringify failed for section2, key1")
177189 }
178190 }