Index: TODO =================================================================== diff -u -r8c8969ab850d118f76305689bd95e980b8f4543f -r8f4072d4e6bb8bae0ab7ef7e0b78526ad7852453 --- TODO (.../TODO) (revision 8c8969ab850d118f76305689bd95e980b8f4543f) +++ TODO (.../TODO) (revision 8f4072d4e6bb8bae0ab7ef7e0b78526ad7852453) @@ -3958,7 +3958,14 @@ - make ::nsf::log more robust for aolserver/naviserver, since ::ns_log is not always around when an output is needed +- serializer: + * make [::Serializer deepSerialize -ignoreVarsRE "" $o] behave like + [::Serializer deepSerialize $o], since learn@wu depends on that, and + a value for ignoreVarsRE of empty looks more like an omitted value than + a regular expression, that should match everything. + * extended regression test + ======================================================================== TODO: Index: library/serialize/serializer.tcl =================================================================== diff -u -rf9dcf9b0efaa245cf8839e9de9e1e5c5f0d3d018 -r8f4072d4e6bb8bae0ab7ef7e0b78526ad7852453 --- library/serialize/serializer.tcl (.../serializer.tcl) (revision f9dcf9b0efaa245cf8839e9de9e1e5c5f0d3d018) +++ library/serialize/serializer.tcl (.../serializer.tcl) (revision 8f4072d4e6bb8bae0ab7ef7e0b78526ad7852453) @@ -566,8 +566,9 @@ :method collectVars {o s} { set setcmd [list] foreach v [lsort [$o info vars]] { - if {![::nsf::var::exists $s ignoreVarsRE] || \ - ![regexp [::nsf::var::set $s ignoreVarsRE] ${o}::$v]} { + if {![::nsf::var::exists $s ignoreVarsRE] + || [::nsf::var::set $s ignoreVarsRE] eq "" + || ![regexp [::nsf::var::set $s ignoreVarsRE] ${o}::$v]} { if {[::nsf::var::exists $o $v] == 0} { puts stderr "strange, [list $o info vars] returned $v, but it does not seem to exist" continue Index: tests/serialize.test =================================================================== diff -u -rf9dcf9b0efaa245cf8839e9de9e1e5c5f0d3d018 -r8f4072d4e6bb8bae0ab7ef7e0b78526ad7852453 --- tests/serialize.test (.../serialize.test) (revision f9dcf9b0efaa245cf8839e9de9e1e5c5f0d3d018) +++ tests/serialize.test (.../serialize.test) (revision 8f4072d4e6bb8bae0ab7ef7e0b78526ad7852453) @@ -71,10 +71,11 @@ ? {c1 a 1} 1 ? {c1 b 1} 1 - set c1(All) [list [::Serializer deepSerialize c1] "a b"] + set c1(IgnoreNone1) [list [::Serializer deepSerialize c1] "a b"] + set c1(IgnoreNone2) [list [::Serializer deepSerialize -ignoreVarsRE "" c1] "a b"] set c1(One) [list [::Serializer deepSerialize -ignoreVarsRE "a" c1] "b"] set c1(One2) [list [::Serializer deepSerialize -ignoreVarsRE {::a$} c1] "b"] - set c1(None1) [list [::Serializer deepSerialize -ignoreVarsRE "" c1] ""] + set c1(IgnoreAll) [list [::Serializer deepSerialize -ignoreVarsRE "." c1] ""] set c1(None2) [list [::Serializer deepSerialize -ignoreVarsRE \ [join [C info slot names] |] c1] ""] @@ -90,10 +91,11 @@ } - set C(All) [list [::Serializer deepSerialize C] "x y"] + set C(IgnoreNone1) [list [::Serializer deepSerialize C] "x y"] + set C(IgnoreNone2) [list [::Serializer deepSerialize -ignoreVarsRE "" C] "x y"] set C(One) [list [::Serializer deepSerialize -ignoreVarsRE "x" C] "y"] set C(One2) [list [::Serializer deepSerialize -ignoreVarsRE {::x$} C] "y"] - set C(None1) [list [::Serializer deepSerialize -ignoreVarsRE "" C] ""] + set C(IgnoreAll) [list [::Serializer deepSerialize -ignoreVarsRE "." C] ""] set C(None2) [list [::Serializer deepSerialize \ -ignoreVarsRE [join [C class info slot names] |] C] ""]