(t *testing.T)
| 1737 | } |
| 1738 | |
| 1739 | func TestBinOp(t *testing.T) { |
| 1740 | testCases := []struct { |
| 1741 | op Operator |
| 1742 | lhs Static |
| 1743 | rhs Static |
| 1744 | expected Static |
| 1745 | symmetric bool |
| 1746 | err error |
| 1747 | }{ |
| 1748 | { |
| 1749 | op: OpGreater, |
| 1750 | lhs: NewStaticString("foo"), |
| 1751 | rhs: NewStaticString(""), |
| 1752 | expected: StaticTrue, |
| 1753 | }, |
| 1754 | // Comparisons of strings starting with a number were previously broken. |
| 1755 | { |
| 1756 | op: OpGreater, |
| 1757 | lhs: NewStaticString("123"), |
| 1758 | rhs: NewStaticString(""), |
| 1759 | expected: StaticTrue, |
| 1760 | }, |
| 1761 | // Test cases for of IN/NOT IN array operations |
| 1762 | { |
| 1763 | op: OpIn, |
| 1764 | lhs: NewStaticInt(2), |
| 1765 | rhs: NewStaticIntArray([]int{1, 2, 3}), |
| 1766 | expected: StaticTrue, |
| 1767 | }, |
| 1768 | { |
| 1769 | op: OpIn, |
| 1770 | lhs: NewStaticInt(2), |
| 1771 | rhs: NewStaticStringArray([]string{"1", "2", "3"}), |
| 1772 | expected: StaticFalse, |
| 1773 | }, |
| 1774 | { |
| 1775 | op: OpNotIn, |
| 1776 | lhs: NewStaticString("1"), |
| 1777 | rhs: NewStaticStringArray([]string{"2", "3", "4"}), |
| 1778 | expected: StaticTrue, |
| 1779 | }, |
| 1780 | { |
| 1781 | op: OpNotIn, |
| 1782 | lhs: NewStaticString("3"), |
| 1783 | rhs: NewStaticStringArray([]string{"1", "2", "3"}), |
| 1784 | expected: StaticFalse, |
| 1785 | }, |
| 1786 | { |
| 1787 | op: OpEqual, |
| 1788 | lhs: NewStaticInt(2), |
| 1789 | rhs: NewStaticIntArray([]int{1, 2, 3}), |
| 1790 | expected: StaticTrue, |
| 1791 | symmetric: true, |
| 1792 | }, |
| 1793 | { |
| 1794 | op: OpNotEqual, |
| 1795 | lhs: NewStaticString("1"), |
| 1796 | rhs: NewStaticStringArray([]string{"2", "3", "4"}), |
nothing calls this directly
no test coverage detected