summaryrefslogtreecommitdiff
path: root/tests/auto/language/testdata/versionCompare.qbs
blob: 8a363bf6e3e1db9e09b3f504b6cc9914a8c22892 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import qbs.Utilities

Product {
    name: {
        var e = "unexpected comparison result";
        if (Utilities.versionCompare("1.5", "1.5") !== 0)
            throw e;
        if (Utilities.versionCompare("1.5", "1.5.0") !== 0)
            throw e;
        if (Utilities.versionCompare("1.5", "1.6") >= 0)
            throw e;
        if (Utilities.versionCompare("1.6", "1.5") <= 0)
            throw e;
        if (Utilities.versionCompare("2.5", "1.6") <= 0)
            throw e;
        if (Utilities.versionCompare("1.6", "2.5") >= 0)
            throw e;
        return "versionCompare";
    }
}