OLD | NEW |
(Empty) | |
| 1 // Copyright 2013 The Go Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style |
| 3 // license that can be found in the LICENSE file. |
| 4 |
| 5 package cldr |
| 6 |
| 7 // This file contains test data. |
| 8 |
| 9 import ( |
| 10 "io" |
| 11 "strings" |
| 12 ) |
| 13 |
| 14 type testLoader struct { |
| 15 } |
| 16 |
| 17 func (t testLoader) Len() int { |
| 18 return len(testFiles) |
| 19 } |
| 20 |
| 21 func (t testLoader) Path(i int) string { |
| 22 return testPaths[i] |
| 23 } |
| 24 |
| 25 func (t testLoader) Reader(i int) (io.ReadCloser, error) { |
| 26 return &reader{*strings.NewReader(testFiles[i])}, nil |
| 27 } |
| 28 |
| 29 // reader adds a dummy Close method to strings.Reader so that it |
| 30 // satisfies the io.ReadCloser interface. |
| 31 type reader struct { |
| 32 strings.Reader |
| 33 } |
| 34 |
| 35 func (r reader) Close() error { |
| 36 return nil |
| 37 } |
| 38 |
| 39 var ( |
| 40 testFiles = []string{de_xml, gsw_xml, root_xml} |
| 41 testPaths = []string{ |
| 42 "common/main/de.xml", |
| 43 "common/main/gsw.xml", |
| 44 "common/main/root.xml", |
| 45 } |
| 46 ) |
| 47 |
| 48 var root_xml = `<?xml version="1.0" encoding="UTF-8" ?> |
| 49 <!DOCTYPE ldml SYSTEM "../../common/dtd/ldml.dtd"> |
| 50 <ldml> |
| 51 <identity> |
| 52 <language type="root"/> |
| 53 <generation date="now"/> |
| 54 </identity> |
| 55 <characters> |
| 56 <exemplarCharacters>[]</exemplarCharacters> |
| 57 <exemplarCharacters type="auxiliary">[]</exemplarCharacters> |
| 58 <exemplarCharacters type="punctuation">[\- ‐ – — … ' ‘ ‚ "
“ „ \& #]</exemplarCharacters> |
| 59 <ellipsis type="final">{0}…</ellipsis> |
| 60 <ellipsis type="initial">…{0}</ellipsis> |
| 61 <moreInformation>?</moreInformation> |
| 62 </characters> |
| 63 <dates> |
| 64 <calendars> |
| 65 <default choice="gregorian"/> |
| 66 <calendar type="buddhist"> |
| 67 <months> |
| 68 <alias source="locale" path="../../calen
dar[@type='gregorian']/months"/> |
| 69 </months> |
| 70 </calendar> |
| 71 <calendar type="chinese"> |
| 72 <months> |
| 73 <alias source="locale" path="../../calen
dar[@type='gregorian']/months"/> |
| 74 </months> |
| 75 </calendar> |
| 76 <calendar type="gregorian"> |
| 77 <months> |
| 78 <default choice="format"/> |
| 79 <monthContext type="format"> |
| 80 <default choice="wide"/> |
| 81 <monthWidth type="narrow"> |
| 82 <alias source="locale" p
ath="../../monthContext[@type='stand-alone']/monthWidth[@type='narrow']"/> |
| 83 </monthWidth> |
| 84 <monthWidth type="wide"> |
| 85 <month type="1">11</mont
h> |
| 86 <month type="2">22</mont
h> |
| 87 <month type="3">33</mont
h> |
| 88 <month type="4">44</mont
h> |
| 89 </monthWidth> |
| 90 </monthContext> |
| 91 <monthContext type="stand-alone"> |
| 92 <monthWidth type="narrow"> |
| 93 <month type="1">1</month
> |
| 94 <month type="2">2</month
> |
| 95 <month type="3">3</month
> |
| 96 <month type="4">4</month
> |
| 97 </monthWidth> |
| 98 <monthWidth type="wide"> |
| 99 <alias source="locale" p
ath="../../monthContext[@type='format']/monthWidth[@type='wide']"/> |
| 100 </monthWidth> |
| 101 </monthContext> |
| 102 </months> |
| 103 </calendar> |
| 104 </calendars> |
| 105 </dates> |
| 106 </ldml> |
| 107 ` |
| 108 |
| 109 var de_xml = `<?xml version="1.0" encoding="UTF-8" ?> |
| 110 <!DOCTYPE ldml SYSTEM "../../common/dtd/ldml.dtd"> |
| 111 <ldml> |
| 112 <identity> |
| 113 <language type="de"/> |
| 114 </identity> |
| 115 <characters> |
| 116 <exemplarCharacters>[a ä b c d e ö p q r s ß t u ü v w x y z]</e
xemplarCharacters> |
| 117 <exemplarCharacters type="auxiliary">[á à ă]</exemplarCharacters
> |
| 118 <exemplarCharacters type="index">[A B C D E F G H Z]</exemplarCh
aracters> |
| 119 <ellipsis type="final">{0} …</ellipsis> |
| 120 <ellipsis type="initial">… {0}</ellipsis> |
| 121 <moreInformation>?</moreInformation> |
| 122 <stopwords> |
| 123 <stopwordList type="collation" draft="provisional">der d
ie das</stopwordList> |
| 124 </stopwords> |
| 125 </characters> |
| 126 <dates> |
| 127 <calendars> |
| 128 <calendar type="buddhist"> |
| 129 <months> |
| 130 <monthContext type="format"> |
| 131 <monthWidth type="narrow"> |
| 132 <month type="3">BBB</mon
th> |
| 133 </monthWidth> |
| 134 <monthWidth type="wide"> |
| 135 <month type="3">bbb</mon
th> |
| 136 </monthWidth> |
| 137 </monthContext> |
| 138 </months> |
| 139 </calendar> |
| 140 <calendar type="gregorian"> |
| 141 <months> |
| 142 <monthContext type="format"> |
| 143 <monthWidth type="narrow"> |
| 144 <month type="3">M</month
> |
| 145 <month type="4">A</month
> |
| 146 </monthWidth> |
| 147 <monthWidth type="wide"> |
| 148 <month type="3">Maerz</m
onth> |
| 149 <month type="4">April</m
onth> |
| 150 <month type="5">Mai</mon
th> |
| 151 </monthWidth> |
| 152 </monthContext> |
| 153 <monthContext type="stand-alone"> |
| 154 <monthWidth type="narrow"> |
| 155 <month type="3">m</month
> |
| 156 <month type="5">m</month
> |
| 157 </monthWidth> |
| 158 <monthWidth type="wide"> |
| 159 <month type="4">april</m
onth> |
| 160 <month type="5">mai</mon
th> |
| 161 </monthWidth> |
| 162 </monthContext> |
| 163 </months> |
| 164 </calendar> |
| 165 </calendars> |
| 166 </dates> |
| 167 <posix> |
| 168 <messages> |
| 169 <yesstr>yes:y</yesstr> |
| 170 <nostr>no:n</nostr> |
| 171 </messages> |
| 172 </posix> |
| 173 </ldml> |
| 174 ` |
| 175 |
| 176 var gsw_xml = `<?xml version="1.0" encoding="UTF-8" ?> |
| 177 <!DOCTYPE ldml SYSTEM "../../common/dtd/ldml.dtd"> |
| 178 <ldml> |
| 179 <identity> |
| 180 <language type="gsw"/> |
| 181 </identity> |
| 182 <posix> |
| 183 <alias source="de" path="//ldml/posix"/> |
| 184 </posix> |
| 185 </ldml> |
| 186 ` |
OLD | NEW |