Mercurial > hg
diff tests/test-command-template.t @ 38289:f9c426385853
templater: abstract truth testing to fix {if(list_of_empty_strings)}
Non-empty list should always be True even if it's stringified to ''. Spotted
by Martin von Zweigbergk.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 09 Jun 2018 13:34:47 +0900 |
parents | 851fc9d42d6d |
children | 88e7105b5cd9 |
line wrap: on
line diff
--- a/tests/test-command-template.t Tue Jun 12 23:17:38 2018 +0900 +++ b/tests/test-command-template.t Sat Jun 09 13:34:47 2018 +0900 @@ -4151,6 +4151,10 @@ empty string is False $ hg log -r 0 -T '{if(revset(r"0 - 0"), "", "empty list is False")}\n' empty list is False + $ hg log -r 0 -T '{if(revset(r"0"), "non-empty list is True")}\n' + non-empty list is True + $ hg log -r 0 -T '{if(revset(r"0") % "", "list of empty strings is True")}\n' + list of empty strings is True $ hg log -r 0 -T '{if(true, "true is True")}\n' true is True $ hg log -r 0 -T '{if(false, "", "false is False")}\n'