summaryrefslogtreecommitdiff
path: root/pkgtools/check-portability/files/testdata/test-eqeq
blob: fbfa2c618a74c65abe62074d1ff57cc4be6eb350 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#! /bin/sh
#
# This file demonstrates which patterns are detected by the check for
# the == operator.

test a = b	# good
test a == b	# bad

[ a = b ]	# good
[ a == b ]	# bad

# The check does not look at the closing bracket as that would generate
# too many special cases.
[ a == b -a c == d ]

# This case is not found since the == operator is not at the beginning
# of the condition. This constellation doesn't occur in practice though.
[ a = b -a c == d ]