-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathsuppression-test.rkt
More file actions
68 lines (50 loc) · 1.61 KB
/
suppression-test.rkt
File metadata and controls
68 lines (50 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#lang resyntax/test
require: resyntax/default-recommendations boolean-shortcuts
header:
------------------------------
#lang racket/base
(require resyntax/base)
------------------------------
no-change-test: "suppressing a rule prevents its application"
------------------------------
(resyntax-suppress nested-and-to-flat-and
(and 1 (and 2 3)))
------------------------------
no-change-test: "suppressed nested or is not refactored"
------------------------------
(resyntax-suppress nested-or-to-flat-or
(or 1 (or 2 3)))
------------------------------
test: "unsuppressed nested or is refactored normally"
- (or 1 (or 2 3))
- (or 1 2 3)
test: "suppression is specific to the rule name"
------------------------------
(resyntax-suppress nested-or-to-flat-or
(and 1 (and 2 3)))
==============================
(resyntax-suppress nested-or-to-flat-or
(and 1 2 3))
------------------------------
no-change-test: "multiple expressions can be suppressed in one form"
------------------------------
(resyntax-suppress nested-and-to-flat-and
(and 1 (and 2 3))
(and 4 (and 5 6)))
------------------------------
no-change-test: "suppression works with nested forms"
------------------------------
(resyntax-suppress nested-and-to-flat-and
(define x (and 1 (and 2 3)))
(define y (and 4 (and 5 6))))
------------------------------
test: "suppression outside a form doesn't affect it"
------------------------------
(resyntax-suppress nested-and-to-flat-and
(define x 1))
(and 1 (and 2 3))
==============================
(resyntax-suppress nested-and-to-flat-and
(define x 1))
(and 1 2 3)
------------------------------