Skip to content

Commit 9f0e1ed

Browse files
committed
Formatting
1 parent b047dcc commit 9f0e1ed

File tree

4 files changed

+778
-764
lines changed

4 files changed

+778
-764
lines changed

graalpython/com.oracle.graal.python.test.integration/src/com/oracle/graal/python/test/integration/interop/ArgumentsTest.java

Lines changed: 42 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
*/
4141
package com.oracle.graal.python.test.integration.interop;
4242

43-
4443
import static org.junit.Assert.assertEquals;
4544
import static org.junit.Assert.assertTrue;
4645
import static org.junit.Assert.fail;
@@ -92,15 +91,15 @@ public void tearDown() {
9291
}
9392

9493
public interface TestPositionalArgsLong {
95-
long fn (PositionalArguments args);
94+
long fn(PositionalArguments args);
9695
}
9796

9897
@Test
9998
public void testPositionalArgsLength() {
10099
String source = """
101-
def fn (*args)->int:
102-
return len(args)
103-
""";
100+
def fn (*args)->int:
101+
return len(args)
102+
""";
104103

105104
TestPositionalArgsLong module = context.eval(Source.create("python", source)).as(TestPositionalArgsLong.class);
106105
assertEquals(1, module.fn(PositionalArguments.of(22)));
@@ -119,13 +118,13 @@ def fn (*args)->int:
119118
@Test
120119
public void testPositionalArgsWithNoneValue() {
121120
String source = """
122-
def fn (*args):
123-
result = 0;
124-
for arg in args:
125-
if arg is None:
126-
result = result + 1;
127-
return result
128-
""";
121+
def fn (*args):
122+
result = 0;
123+
for arg in args:
124+
if arg is None:
125+
result = result + 1;
126+
return result
127+
""";
129128

130129
TestPositionalArgsLong module = context.eval(Source.create("python", source)).as(TestPositionalArgsLong.class);
131130
assertEquals(0, module.fn(PositionalArguments.of(22)));
@@ -141,18 +140,18 @@ def fn (*args):
141140
}
142141

143142
public interface TestPositionalArgs01 {
144-
String fn (Object a, Object b, PositionalArguments args);
143+
String fn(Object a, Object b, PositionalArguments args);
145144
}
146145

147146
@Test
148147
public void testPositionalArgs01() {
149148
String source = """
150-
def fn (a, b, *args):
151-
result = str(a) + str(b);
152-
for arg in args:
153-
result = result + str(arg);
154-
return result
155-
""";
149+
def fn (a, b, *args):
150+
result = str(a) + str(b);
151+
for arg in args:
152+
result = result + str(arg);
153+
return result
154+
""";
156155
TestPositionalArgs01 module = context.eval(Source.create("python", source)).as(TestPositionalArgs01.class);
157156
assertEquals("12", module.fn(1, 2, PositionalArguments.of()));
158157
assertEquals("123", module.fn(1, 2, PositionalArguments.of(3)));
@@ -162,22 +161,26 @@ def fn (a, b, *args):
162161
}
163162

164163
public interface TestPositionalArgs02 {
165-
String fn (Object a);
166-
String fn (Object a, PositionalArguments args);
167-
String fn (PositionalArguments args);
168-
String fn (Object a, Object b);
169-
String fn (Object a, Object b, PositionalArguments args);
164+
String fn(Object a);
165+
166+
String fn(Object a, PositionalArguments args);
167+
168+
String fn(PositionalArguments args);
169+
170+
String fn(Object a, Object b);
171+
172+
String fn(Object a, Object b, PositionalArguments args);
170173
}
171174

172175
@Test
173176
public void testPositionalArgs02() {
174177
String source = """
175-
def fn (a, b="correct", *args):
176-
result = str(a) + str(b)
177-
for arg in args:
178-
result = result + str(arg)
179-
return result
180-
""";
178+
def fn (a, b="correct", *args):
179+
result = str(a) + str(b)
180+
for arg in args:
181+
result = result + str(arg)
182+
return result
183+
""";
181184
TestPositionalArgs02 module = context.eval(Source.create("python", source)).as(TestPositionalArgs02.class);
182185
assertEquals("1correct", module.fn(1));
183186
assertEquals("12", module.fn(1, 2));
@@ -191,19 +194,20 @@ def fn (a, b="correct", *args):
191194
}
192195

193196
public interface TestKeywordArgs01 {
194-
String fn ();
195-
String fn (KeywordArguments kwArgs);
197+
String fn();
198+
199+
String fn(KeywordArguments kwArgs);
196200
}
197201

198202
@Test
199203
public void testKeywordArgs01() {
200204
String source = """
201-
def fn (**kwArgs):
202-
result = ''
203-
for key, value in kwArgs.items():
204-
result = result + f'[{key}:{str(value)}],'
205-
return result
206-
""";
205+
def fn (**kwArgs):
206+
result = ''
207+
for key, value in kwArgs.items():
208+
result = result + f'[{key}:{str(value)}],'
209+
return result
210+
""";
207211
TestKeywordArgs01 module = context.eval(Source.create("python", source)).as(TestKeywordArgs01.class);
208212
assertEquals("", module.fn());
209213
assertEquals("", module.fn(KeywordArguments.from(new HashMap<>())));

0 commit comments

Comments
 (0)