somevar=
expect "<$HOME>"
recho ${somevar:-~}
-expect "<$HOME>"
+# This changed after bash-3.0, when the tilde implementation was redone. It's
+# not backward compatible, but it's very hard to be backward-compatible here,
+# and I think the old behavior was a bug
+expect '<~>'
recho "${somevar:-~}"
expect '<~>'
recho "${somevar:-"~"}"