Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
80728 views
1
/**
2
* There was an incorrect sort behaviour documented in issue #143:
3
* (x = f(…)) <= x → x >= (x = f(…))
4
*
5
* For example, let the equation be:
6
* (a = parseInt('100')) <= a
7
*
8
* If a was an integer and has the value of 99,
9
* (a = parseInt('100')) <= a → 100 <= 100 → true
10
*
11
* When transformed incorrectly:
12
* a >= (a = parseInt('100')) → 99 >= 100 → false
13
*/
14
15
tranformation_sort_order_equal: {
16
options = {
17
comparisons: true,
18
};
19
20
input: { (a = parseInt('100')) == a }
21
expect: { (a = parseInt('100')) == a }
22
}
23
24
tranformation_sort_order_unequal: {
25
options = {
26
comparisons: true,
27
};
28
29
input: { (a = parseInt('100')) != a }
30
expect: { (a = parseInt('100')) != a }
31
}
32
33
tranformation_sort_order_lesser_or_equal: {
34
options = {
35
comparisons: true,
36
};
37
38
input: { (a = parseInt('100')) <= a }
39
expect: { (a = parseInt('100')) <= a }
40
}
41
tranformation_sort_order_greater_or_equal: {
42
options = {
43
comparisons: true,
44
};
45
46
input: { (a = parseInt('100')) >= a }
47
expect: { (a = parseInt('100')) >= a }
48
}
49