Shopify / liquid

Liquid markup language. Safe, customer facing template language for flexible web apps.
https://shopify.github.io/liquid/
MIT License
11.05k stars 1.38k forks source link

change: make nil_safe_casecmp judge compatible for nil-nil comparison #1760

Closed mtasaka closed 6 months ago

mtasaka commented 10 months ago

Ruby returns 0 (not nil) for nil <=> nil, i.e. nil and nil are judged as equal for comparison, and so returns nil_safe_compare . ref: https://github.com/Shopify/liquid/pull/1476

To make the behavior of nil_safe_casecmp consistent with nil_safe_compare , change nil_safe_casecmp so that comparison between nil <=> nil return 0 (equal).

Also change testsuite to reflect this change.

Fixes #1759 .

ianks commented 9 months ago

This makes sense to me and seems like the correct behavior. @samdoiron thoughts?

ianks commented 9 months ago

@mtasaka I think there is a linting failure in CI

mtasaka commented 9 months ago

@mtasaka I think there is a linting failure in CI

@ianks I've force-pushed my PR with indentation fixed. Would you recheck this?