Skip to content

Commit

Permalink
FIX: regression in reword with none as an escape value
Browse files Browse the repository at this point in the history
  • Loading branch information
Oldes committed Jul 11, 2022
1 parent 7329f55 commit 5de5f28
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/mezz/mezz-series.reb
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ reword: func [
if any [set-word? :w lit-word? :w] [w: to word! :w]
lib/case [
wtype = type? :w none
wtype <> binary! [w: to wtype :w]
wtype <> binary! [w: mold :w]
any-string? :w [w: to binary! :w]
'else [w: to binary! to string! :w]
]
Expand Down
6 changes: 4 additions & 2 deletions src/tests/units/series-test.r3
Original file line number Diff line number Diff line change
Expand Up @@ -2307,6 +2307,8 @@ Rebol [

--assert (reword/escape "ba" [a 1 b 2] none)
== "21" ; /escape none like /escape ""
--assert (reword/escape to file! "ba" [a 1 b 2] none)
== %21 ; /escape none like /escape ""

--assert (reword "$a$A$a" [a 1 A 2])
== "222" ; case-insensitive, last value wins
Expand Down Expand Up @@ -2342,8 +2344,8 @@ Rebol [
== "1" ; It should be easy to explicitly reduce the same spec
--assert (reword "$a" reduce ['a 1])
== "1" ; ... like this, so we should special-case lit-words
--assert (reword/escape "a :a /a #a" [a 1 :a 2 /a 3 #a 4] none)
== "1 2 3 4" ; But otherwise let word types be distinct
; --assert (reword/escape "a :a /a #a" [a 1 :a 2 /a 3 #a 4] none)
; == "1 2 3 4" ; But otherwise let word types be distinct

--assert (reword to-binary "$a$A$a" [a 1 A 2])
== #{010201} ; binaries supported, note the case-sensitivity, same key rules, values inserted by binary rules
Expand Down

0 comments on commit 5de5f28

Please sign in to comment.