Skip to content

Commit d2dc9d6

Browse files
committed
Switch tags with no values to use nil rather than true
1 parent e670242 commit d2dc9d6

File tree

3 files changed

+22
-10
lines changed

3 files changed

+22
-10
lines changed

test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ Options:
183183
continue
184184
}
185185

186-
if value == true {
186+
if value == nil {
187187
if tag.HasValue {
188188
fmt.Println(
189189
"Tag",
@@ -248,7 +248,7 @@ Options:
248248
if test.Atoms.Tags != nil {
249249
tagsDict := make(map[string]ircmsg.TagValue)
250250
for key, value := range test.Atoms.Tags {
251-
if value == true {
251+
if value == nil {
252252
tagsDict[key] = ircmsg.NoTagValue()
253253
} else {
254254
tagsDict[key] = ircmsg.MakeTagValue(value.(string))

tests/msg-join.yaml

+13-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
tests:
2222
# the atoms dict has the keys:
2323
# * tags: tags dict
24-
# tags with no equals sign have a value of true in this file
24+
# tags with no equals sign have a value of null in this file
2525
# tags with no value after = sign have a value of empty string
2626
# * source: source string, without single leading colon
2727
# * verb: verb string
@@ -135,6 +135,18 @@ tests:
135135
- ":coolguy foo bar baz : "
136136

137137
# with tags
138+
- atoms:
139+
tags:
140+
"asd": null
141+
source: "coolguy"
142+
verb: "foo"
143+
params:
144+
- "bar"
145+
- "baz"
146+
- " "
147+
matches:
148+
- "@asd :coolguy foo bar baz : "
149+
138150
- atoms:
139151
verb: "foo"
140152
tags:

tests/msg-split.yaml

+7-7
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ tests:
2828

2929
# the atoms dict has the keys:
3030
# * tags: tags dict
31-
# tags with no equals sign have a value of true in this file
31+
# tags with no equals sign have a value of null in this file
3232
# tags with no value after = sign have a value of empty string
3333
# * source: source string, without single leading colon
3434
# * verb: verb string
@@ -134,7 +134,7 @@ tests:
134134
tags:
135135
"a": "b"
136136
"c": "32"
137-
"k": true
137+
"k": null
138138
"rt": "ql7"
139139

140140
# with escaped tags
@@ -150,7 +150,7 @@ tests:
150150
- input: "@c;h=;a=b :quux ab cd"
151151
atoms:
152152
tags:
153-
"c": true
153+
"c": null
154154
"h": ""
155155
"a": "b"
156156
source: "quux"
@@ -214,9 +214,9 @@ tests:
214214
atoms:
215215
tags:
216216
tag1: "value1"
217-
tag2: true
217+
tag2: null
218218
vendor1/tag3: "value2"
219-
vendor2/tag4: true
219+
vendor2/tag4: null
220220
source: "irc.example.com"
221221
verb: "COMMAND"
222222
params:
@@ -237,9 +237,9 @@ tests:
237237
atoms:
238238
tags:
239239
tag1: "value1"
240-
tag2: true
240+
tag2: null
241241
vendor1/tag3: "value2"
242-
vendor2/tag4: true
242+
vendor2/tag4: null
243243
verb: "COMMAND"
244244
params:
245245
- "param1"

0 commit comments

Comments
 (0)