Skip to content

Commit 479d031

Browse files
author
halirutan
committed
Included tests for Slot
1 parent 7b2a01f commit 479d031

3 files changed

Lines changed: 188 additions & 4 deletions

File tree

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
(* Slots & SlotSequences *)
2+
#&;
3+
#2&;
4+
##&;
5+
##1&;
6+
7+
(* Simple Association Slots *)
8+
#Test&;
9+
#"Test"&;
10+
{#"Test", #"Test2"}&;
11+
12+
(* Function-call like Slot expressions *)
13+
#["Test"]&;
14+
#[Test]&;
15+
16+
(* Yo Dawg, I heard you like Slots... *)
17+
#[#Test]&;
18+
#[#"Test"]&;
19+
#[#Test&, #"Test"&]&;
20+
#Test[#, #"Test"]&;
21+
#"Test"[#Test&, #]&;
Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
FILE(0,313)
2+
PsiComment(COMMENT_START)('(*')(0,2)
3+
PsiComment(COMMENT_CONTENT)(' Slots & SlotSequences ')(2,25)
4+
PsiComment(COMMENT_END)('*)')(25,27)
5+
PsiWhiteSpace('\n')(27,28)
6+
CompoundExpression(28,313)
7+
Function(28,30)
8+
Slot(28,29)
9+
PsiElement(SLOT)('#')(28,29)
10+
PsiElement(FUNCTION)('&')(29,30)
11+
PsiElement(SEMICOLON)(';')(30,31)
12+
PsiWhiteSpace('\n')(31,32)
13+
Function(32,35)
14+
Slot(32,34)
15+
PsiElement(SLOT)('#2')(32,34)
16+
PsiElement(FUNCTION)('&')(34,35)
17+
PsiElement(SEMICOLON)(';')(35,36)
18+
PsiWhiteSpace('\n')(36,37)
19+
Function(37,40)
20+
Slot(37,39)
21+
PsiElement(SLOT_SEQUENCE)('##')(37,39)
22+
PsiElement(FUNCTION)('&')(39,40)
23+
PsiElement(SEMICOLON)(';')(40,41)
24+
PsiWhiteSpace('\n')(41,42)
25+
Function(42,46)
26+
Slot(42,45)
27+
PsiElement(SLOT_SEQUENCE)('##1')(42,45)
28+
PsiElement(FUNCTION)('&')(45,46)
29+
PsiElement(SEMICOLON)(';')(46,47)
30+
PsiWhiteSpace('\n\n')(47,49)
31+
PsiComment(COMMENT_START)('(*')(49,51)
32+
PsiComment(COMMENT_CONTENT)(' Simple Association Slots ')(51,77)
33+
PsiComment(COMMENT_END)('*)')(77,79)
34+
PsiWhiteSpace('\n')(79,80)
35+
Function(80,86)
36+
SlotExpression(80,85)
37+
PsiElement(ASSOCIATION_SLOT)('#Test')(80,85)
38+
PsiElement(FUNCTION)('&')(85,86)
39+
PsiElement(SEMICOLON)(';')(86,87)
40+
PsiWhiteSpace('\n')(87,88)
41+
Function(88,96)
42+
SlotExpression(88,95)
43+
PsiElement(ASSOCIATION_SLOT)('#"Test"')(88,95)
44+
PsiElement(FUNCTION)('&')(95,96)
45+
PsiElement(SEMICOLON)(';')(96,97)
46+
PsiWhiteSpace('\n')(97,98)
47+
Function(98,118)
48+
List(98,117)
49+
PsiElement(LEFT_BRACE)('{')(98,99)
50+
SlotExpression(99,106)
51+
PsiElement(ASSOCIATION_SLOT)('#"Test"')(99,106)
52+
PsiElement(COMMA)(',')(106,107)
53+
PsiWhiteSpace(' ')(107,108)
54+
SlotExpression(108,116)
55+
PsiElement(ASSOCIATION_SLOT)('#"Test2"')(108,116)
56+
PsiElement(RIGHT_BRACE)('}')(116,117)
57+
PsiElement(FUNCTION)('&')(117,118)
58+
PsiElement(SEMICOLON)(';')(118,119)
59+
PsiWhiteSpace('\n\n')(119,121)
60+
PsiComment(COMMENT_START)('(*')(121,123)
61+
PsiComment(COMMENT_CONTENT)(' Function-call like Slot expressions ')(123,160)
62+
PsiComment(COMMENT_END)('*)')(160,162)
63+
PsiWhiteSpace('\n')(162,163)
64+
Function(163,173)
65+
SlotExpression(163,172)
66+
Slot(163,164)
67+
PsiElement(SLOT)('#')(163,164)
68+
PsiElement(LEFT_BRACKET)('[')(164,165)
69+
String(165,171)
70+
PsiElement(STRING_LITERAL_BEGIN)('"')(165,166)
71+
PsiElement(STRING_LITERAL)('Test')(166,170)
72+
PsiElement(STRING_LITERAL_END)('"')(170,171)
73+
PsiElement(RIGHT_BRACKET)(']')(171,172)
74+
PsiElement(FUNCTION)('&')(172,173)
75+
PsiElement(SEMICOLON)(';')(173,174)
76+
PsiWhiteSpace('\n')(174,175)
77+
Function(175,183)
78+
SlotExpression(175,182)
79+
Slot(175,176)
80+
PsiElement(SLOT)('#')(175,176)
81+
PsiElement(LEFT_BRACKET)('[')(176,177)
82+
Symbol(177,181)
83+
PsiElement(IDENTIFIER)('Test')(177,181)
84+
PsiElement(RIGHT_BRACKET)(']')(181,182)
85+
PsiElement(FUNCTION)('&')(182,183)
86+
PsiElement(SEMICOLON)(';')(183,184)
87+
PsiWhiteSpace('\n\n')(184,186)
88+
PsiComment(COMMENT_START)('(*')(186,188)
89+
PsiComment(COMMENT_CONTENT)(' Yo Dawg, I heard you like Slots... ')(188,224)
90+
PsiComment(COMMENT_END)('*)')(224,226)
91+
PsiWhiteSpace('\n')(226,227)
92+
Function(227,236)
93+
SlotExpression(227,235)
94+
Slot(227,228)
95+
PsiElement(SLOT)('#')(227,228)
96+
PsiElement(LEFT_BRACKET)('[')(228,229)
97+
SlotExpression(229,234)
98+
PsiElement(ASSOCIATION_SLOT)('#Test')(229,234)
99+
PsiElement(RIGHT_BRACKET)(']')(234,235)
100+
PsiElement(FUNCTION)('&')(235,236)
101+
PsiElement(SEMICOLON)(';')(236,237)
102+
PsiWhiteSpace('\n')(237,238)
103+
Function(238,249)
104+
SlotExpression(238,248)
105+
Slot(238,239)
106+
PsiElement(SLOT)('#')(238,239)
107+
PsiElement(LEFT_BRACKET)('[')(239,240)
108+
SlotExpression(240,247)
109+
PsiElement(ASSOCIATION_SLOT)('#"Test"')(240,247)
110+
PsiElement(RIGHT_BRACKET)(']')(247,248)
111+
PsiElement(FUNCTION)('&')(248,249)
112+
PsiElement(SEMICOLON)(';')(249,250)
113+
PsiWhiteSpace('\n')(250,251)
114+
Function(251,271)
115+
SlotExpression(251,270)
116+
Slot(251,252)
117+
PsiElement(SLOT)('#')(251,252)
118+
PsiElement(LEFT_BRACKET)('[')(252,253)
119+
Function(253,259)
120+
SlotExpression(253,258)
121+
PsiElement(ASSOCIATION_SLOT)('#Test')(253,258)
122+
PsiElement(FUNCTION)('&')(258,259)
123+
PsiElement(COMMA)(',')(259,260)
124+
PsiWhiteSpace(' ')(260,261)
125+
Function(261,269)
126+
SlotExpression(261,268)
127+
PsiElement(ASSOCIATION_SLOT)('#"Test"')(261,268)
128+
PsiElement(FUNCTION)('&')(268,269)
129+
PsiElement(RIGHT_BRACKET)(']')(269,270)
130+
PsiElement(FUNCTION)('&')(270,271)
131+
PsiElement(SEMICOLON)(';')(271,272)
132+
PsiWhiteSpace('\n')(272,273)
133+
Function(273,291)
134+
FunctionCall(273,290)
135+
SlotExpression(273,278)
136+
PsiElement(ASSOCIATION_SLOT)('#Test')(273,278)
137+
PsiElement(LEFT_BRACKET)('[')(278,279)
138+
Slot(279,280)
139+
PsiElement(SLOT)('#')(279,280)
140+
PsiElement(COMMA)(',')(280,281)
141+
PsiWhiteSpace(' ')(281,282)
142+
SlotExpression(282,289)
143+
PsiElement(ASSOCIATION_SLOT)('#"Test"')(282,289)
144+
PsiElement(RIGHT_BRACKET)(']')(289,290)
145+
PsiElement(FUNCTION)('&')(290,291)
146+
PsiElement(SEMICOLON)(';')(291,292)
147+
PsiWhiteSpace('\n')(292,293)
148+
Function(293,312)
149+
FunctionCall(293,311)
150+
SlotExpression(293,300)
151+
PsiElement(ASSOCIATION_SLOT)('#"Test"')(293,300)
152+
PsiElement(LEFT_BRACKET)('[')(300,301)
153+
Function(301,307)
154+
SlotExpression(301,306)
155+
PsiElement(ASSOCIATION_SLOT)('#Test')(301,306)
156+
PsiElement(FUNCTION)('&')(306,307)
157+
PsiElement(COMMA)(',')(307,308)
158+
PsiWhiteSpace(' ')(308,309)
159+
Slot(309,310)
160+
PsiElement(SLOT)('#')(309,310)
161+
PsiElement(RIGHT_BRACKET)(']')(310,311)
162+
PsiElement(FUNCTION)('&')(311,312)
163+
PsiElement(SEMICOLON)(';')(312,313)

tests/de/halirutan/mathematica/parsing/MathematicaParsingTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@
2121

2222
package de.halirutan.mathematica.parsing;
2323

24-
import com.intellij.testFramework.ParsingTestCase;
25-
import de.halirutan.mathematica.MathematicaTestUtils;
26-
import de.halirutan.mathematica.parsing.prattparser.MathematicaParserDefinition;
27-
2824
/**
2925
* @author patrick (8/16/14)
3026
*/
@@ -34,4 +30,8 @@ public void testParsingTestData() throws Exception {
3430
doTest(true);
3531
}
3632

33+
public void testSlot() throws Exception {
34+
doTest(true);
35+
}
36+
3737
}

0 commit comments

Comments
 (0)