~tcuthbert/wordpress/openstack-objectstorage

« back to all changes in this revision

Viewing changes to vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsTypeTransfers.yml

  • Committer: Jacek Nykis
  • Date: 2015-02-11 15:35:31 UTC
  • Revision ID: jacek.nykis@canonical.com-20150211153531-hmy6zi0ov2qfkl0b
Initial commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--- %YAML:1.0
 
2
test: Strings
 
3
brief: >
 
4
    Any group of characters beginning with an
 
5
    alphabetic or numeric character is a string,
 
6
    unless it belongs to one of the groups below
 
7
    (such as an Integer or Time).
 
8
yaml: |
 
9
    String
 
10
php: |
 
11
    'String'
 
12
---
 
13
test: String characters
 
14
brief: >
 
15
    A string can contain any alphabetic or
 
16
    numeric character, along with many
 
17
    punctuation characters, including the
 
18
    period, dash, space, quotes, exclamation, and
 
19
    question mark.
 
20
yaml: |
 
21
    - What's Yaml?
 
22
    - It's for writing data structures in plain text.
 
23
    - And?
 
24
    - And what? That's not good enough for you?
 
25
    - No, I mean, "And what about Yaml?"
 
26
    - Oh, oh yeah. Uh.. Yaml for Ruby.
 
27
php: |
 
28
    array(
 
29
      "What's Yaml?",
 
30
      "It's for writing data structures in plain text.",
 
31
      "And?",
 
32
      "And what? That's not good enough for you?",
 
33
      "No, I mean, \"And what about Yaml?\"",
 
34
      "Oh, oh yeah. Uh.. Yaml for Ruby."
 
35
    )
 
36
---
 
37
test: Indicators in Strings
 
38
brief: >
 
39
    Be careful using indicators in strings.  In particular,
 
40
    the comma, colon, and pound sign must be used carefully.
 
41
yaml: |
 
42
    the colon followed by space is an indicator: but is a string:right here
 
43
    same for the pound sign: here we have it#in a string
 
44
    the comma can, honestly, be used in most cases: [ but not in, inline collections ]
 
45
php: |
 
46
    array(
 
47
      'the colon followed by space is an indicator' => 'but is a string:right here',
 
48
      'same for the pound sign' => 'here we have it#in a string',
 
49
      'the comma can, honestly, be used in most cases' => array('but not in', 'inline collections')
 
50
    )
 
51
---
 
52
test: Forcing Strings
 
53
brief: >
 
54
    Any YAML type can be forced into a string using the
 
55
    explicit !str method.
 
56
yaml: |
 
57
    date string: !str 2001-08-01
 
58
    number string: !str 192
 
59
php: |
 
60
    array(
 
61
      'date string' => '2001-08-01',
 
62
      'number string' => '192'
 
63
    )
 
64
---
 
65
test: Single-quoted Strings
 
66
brief: >
 
67
    You can also enclose your strings within single quotes,
 
68
    which allows use of slashes, colons, and other indicators
 
69
    freely.  Inside single quotes, you can represent a single
 
70
    quote in your string by using two single quotes next to
 
71
    each other.
 
72
yaml: |
 
73
    all my favorite symbols: '#:!/%.)'
 
74
    a few i hate: '&(*'
 
75
    why do i hate them?: 'it''s very hard to explain'
 
76
    entities: '£ me'
 
77
php: |
 
78
    array(
 
79
      'all my favorite symbols' => '#:!/%.)',
 
80
      'a few i hate' => '&(*',
 
81
      'why do i hate them?' => 'it\'s very hard to explain',
 
82
      'entities' => '£ me'
 
83
    )
 
84
---
 
85
test: Double-quoted Strings
 
86
brief: >
 
87
    Enclosing strings in double quotes allows you
 
88
    to use escapings to represent ASCII and
 
89
    Unicode characters.
 
90
yaml: |
 
91
    i know where i want my line breaks: "one here\nand another here\n"
 
92
php: |
 
93
    array(
 
94
      'i know where i want my line breaks' => "one here\nand another here\n"
 
95
    )
 
96
---
 
97
test: Multi-line Quoted Strings
 
98
todo: true
 
99
brief: >
 
100
    Both single- and double-quoted strings may be
 
101
    carried on to new lines in your YAML document.
 
102
    They must be indented a step and indentation
 
103
    is interpreted as a single space.
 
104
yaml: |
 
105
    i want a long string: "so i'm going to
 
106
      let it go on and on to other lines
 
107
      until i end it with a quote."
 
108
php: |
 
109
    array('i want a long string' => "so i'm going to ".
 
110
         "let it go on and on to other lines ".
 
111
         "until i end it with a quote."
 
112
    )
 
113
 
 
114
---
 
115
test: Plain scalars
 
116
todo: true
 
117
brief: >
 
118
    Unquoted strings may also span multiple lines, if they
 
119
    are free of YAML space indicators and indented.
 
120
yaml: |
 
121
    - My little toe is broken in two places;
 
122
    - I'm crazy to have skied this way;
 
123
    - I'm not the craziest he's seen, since there was always the German guy
 
124
      who skied for 3 hours on a broken shin bone (just below the kneecap);
 
125
    - Nevertheless, second place is respectable, and he doesn't
 
126
      recommend going for the record;
 
127
    - He's going to put my foot in plaster for a month;
 
128
    - This would impair my skiing ability somewhat for the
 
129
      duration, as can be imagined.
 
130
php: |
 
131
    array(
 
132
      "My little toe is broken in two places;",
 
133
      "I'm crazy to have skied this way;",
 
134
      "I'm not the craziest he's seen, since there was always ".
 
135
         "the German guy who skied for 3 hours on a broken shin ".
 
136
         "bone (just below the kneecap);",
 
137
      "Nevertheless, second place is respectable, and he doesn't ".
 
138
         "recommend going for the record;",
 
139
      "He's going to put my foot in plaster for a month;",
 
140
      "This would impair my skiing ability somewhat for the duration, ".
 
141
         "as can be imagined."
 
142
    )
 
143
---
 
144
test: 'Null'
 
145
brief: >
 
146
    You can use the tilde '~' character for a null value.
 
147
yaml: |
 
148
    name: Mr. Show
 
149
    hosted by: Bob and David
 
150
    date of next season: ~
 
151
php: |
 
152
    array(
 
153
      'name' => 'Mr. Show',
 
154
      'hosted by' => 'Bob and David',
 
155
      'date of next season' => null
 
156
    )
 
157
---
 
158
test: Boolean
 
159
brief: >
 
160
    You can use 'true' and 'false' for Boolean values.
 
161
yaml: |
 
162
    Is Gus a Liar?: true
 
163
    Do I rely on Gus for Sustenance?: false
 
164
php: |
 
165
    array(
 
166
      'Is Gus a Liar?' => true,
 
167
      'Do I rely on Gus for Sustenance?' => false
 
168
    )
 
169
---
 
170
test: Integers
 
171
dump_skip: true
 
172
brief: >
 
173
    An integer is a series of numbers, optionally
 
174
    starting with a positive or negative sign.  Integers
 
175
    may also contain commas for readability.
 
176
yaml: |
 
177
    zero: 0
 
178
    simple: 12
 
179
    one-thousand: 1,000
 
180
    negative one-thousand: -1,000
 
181
php: |
 
182
    array(
 
183
      'zero' => 0,
 
184
      'simple' => 12,
 
185
      'one-thousand' => 1000,
 
186
      'negative one-thousand' => -1000
 
187
    )
 
188
---
 
189
test: Integers as Map Keys
 
190
brief: >
 
191
    An integer can be used a dictionary key.
 
192
yaml: |
 
193
    1: one
 
194
    2: two
 
195
    3: three
 
196
php: |
 
197
    array(
 
198
        1 => 'one',
 
199
        2 => 'two',
 
200
        3 => 'three'
 
201
    )
 
202
---
 
203
test: Floats
 
204
dump_skip: true
 
205
brief: >
 
206
     Floats are represented by numbers with decimals,
 
207
     allowing for scientific notation, as well as
 
208
     positive and negative infinity and "not a number."
 
209
yaml: |
 
210
     a simple float: 2.00
 
211
     larger float: 1,000.09
 
212
     scientific notation: 1.00009e+3
 
213
php: |
 
214
     array(
 
215
       'a simple float' => 2.0,
 
216
       'larger float' => 1000.09,
 
217
       'scientific notation' => 1000.09
 
218
     )
 
219
---
 
220
test: Time
 
221
todo: true
 
222
brief: >
 
223
    You can represent timestamps by using
 
224
    ISO8601 format, or a variation which
 
225
    allows spaces between the date, time and
 
226
    time zone.
 
227
yaml: |
 
228
    iso8601: 2001-12-14t21:59:43.10-05:00
 
229
    space separated: 2001-12-14 21:59:43.10 -05:00
 
230
php: |
 
231
    array(
 
232
      'iso8601' => mktime( 2001, 12, 14, 21, 59, 43, 0.10, "-05:00" ),
 
233
      'space separated' => mktime( 2001, 12, 14, 21, 59, 43, 0.10, "-05:00" )
 
234
    )
 
235
---
 
236
test: Date
 
237
todo: true
 
238
brief: >
 
239
    A date can be represented by its year,
 
240
    month and day in ISO8601 order.
 
241
yaml: |
 
242
    1976-07-31
 
243
php: |
 
244
    date( 1976, 7, 31 )