Skip to content

Commit 9005adf

Browse files
authored
Fix formatting indent of multiline strings in test/ (#3064)
1 parent ad8cf99 commit 9005adf

5 files changed

Lines changed: 181 additions & 181 deletions

File tree

test/Bridges/General/test_bridge_optimizer.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -268,11 +268,11 @@ function test_issue_453()
268268
MOI.Utilities.loadfromstring!(
269269
bridged_mock,
270270
"""
271-
variables: x
272-
maxobjective: 3.0x
273-
c: 2.0x in Interval(1.0, 4.0)
274-
x in LessThan(1.5)
275-
""",
271+
variables: x
272+
maxobjective: 3.0x
273+
c: 2.0x in Interval(1.0, 4.0)
274+
x in LessThan(1.5)
275+
""",
276276
)
277277
x = MOI.get(bridged_mock, MOI.VariableIndex, "x")
278278
@test isa(x, MOI.VariableIndex)

test/FileFormats/LP/test_LP.jl

Lines changed: 57 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -36,21 +36,21 @@ function test_comprehensive_write()
3636
MOI.Utilities.loadfromstring!(
3737
model,
3838
"""
39-
variables: a, x, y, z
40-
minobjective: x
41-
x >= -1.0
42-
x <= 2.0
43-
y == 3.0
44-
z in Interval(4.0, 5.0)
45-
c5: 1.1x + 0.0 <= 5.1
46-
c6: 1.3x + -1.4 >= -0.1
47-
c7: 1.5a + 1.6 == 0.2
48-
c8: 1.7a + 1.8 in Interval(0.3, 0.4)
49-
x in ZeroOne()
50-
y in Integer()
51-
c11: [x, y, z] in SOS1{Float64}([1.0, 2.0, 3.0])
52-
c12: [x, y, z] in SOS2{Float64}([3.3, 1.1, 2.2])
53-
""",
39+
variables: a, x, y, z
40+
minobjective: x
41+
x >= -1.0
42+
x <= 2.0
43+
y == 3.0
44+
z in Interval(4.0, 5.0)
45+
c5: 1.1x + 0.0 <= 5.1
46+
c6: 1.3x + -1.4 >= -0.1
47+
c7: 1.5a + 1.6 == 0.2
48+
c8: 1.7a + 1.8 in Interval(0.3, 0.4)
49+
x in ZeroOne()
50+
y in Integer()
51+
c11: [x, y, z] in SOS1{Float64}([1.0, 2.0, 3.0])
52+
c12: [x, y, z] in SOS2{Float64}([3.3, 1.1, 2.2])
53+
""",
5454
)
5555
MOI.write_to_file(model, LP_TEST_FILE)
5656
@test read(LP_TEST_FILE, String) ==
@@ -86,10 +86,10 @@ function test_name_sanitization_start()
8686
MOI.Utilities.loadfromstring!(
8787
model,
8888
"""
89-
variables: x
90-
minobjective: x
91-
c1: 1.0 * x >= -1.0
92-
""",
89+
variables: x
90+
minobjective: x
91+
c1: 1.0 * x >= -1.0
92+
""",
9393
)
9494
x = MOI.get(model, MOI.VariableIndex, "x")
9595
MOI.set(model, MOI.VariableName(), x, starting_letter * "x")
@@ -113,10 +113,10 @@ function test_name_sanitization_illegal()
113113
MOI.Utilities.loadfromstring!(
114114
model,
115115
"""
116-
variables: x
117-
minobjective: x
118-
c1: 1.0 * x >= -1.0
119-
""",
116+
variables: x
117+
minobjective: x
118+
c1: 1.0 * x >= -1.0
119+
""",
120120
)
121121
x = MOI.get(model, MOI.VariableIndex, "x")
122122
MOI.set(model, MOI.VariableName(), x, "x$(illegal_letter)y")
@@ -139,10 +139,10 @@ function test_name_sanitization_duplicate()
139139
MOI.Utilities.loadfromstring!(
140140
model,
141141
"""
142-
variables: a, b, c, d
143-
minobjective: a + b + c + d
144-
c1: a + b + c + d >= -1.0
145-
""",
142+
variables: a, b, c, d
143+
minobjective: a + b + c + d
144+
c1: a + b + c + d >= -1.0
145+
""",
146146
)
147147
variables = MOI.get(model, MOI.ListOfVariableIndices())
148148
MOI.set.(model, MOI.VariableName(), variables, ["a[", "a]", "a*", "a^"])
@@ -181,10 +181,10 @@ function test_name_sanitization_too_long()
181181
MOI.Utilities.loadfromstring!(
182182
model,
183183
"""
184-
variables: abcd, abce
185-
minobjective: abcd + abce
186-
c1: abcd + abce >= -1.0
187-
""",
184+
variables: abcd, abce
185+
minobjective: abcd + abce
186+
c1: abcd + abce >= -1.0
187+
""",
188188
)
189189
MOI.write_to_file(model, LP_TEST_FILE)
190190
@test read(LP_TEST_FILE, String) ==
@@ -203,9 +203,9 @@ function test_name_sanitization_other()
203203
MOI.Utilities.loadfromstring!(
204204
model,
205205
"""
206-
variables: x
207-
maxobjective: 2.0 * x + -1.0
208-
""",
206+
variables: x
207+
maxobjective: 2.0 * x + -1.0
208+
""",
209209
)
210210
MOI.write_to_file(model, LP_TEST_FILE)
211211
@test read(LP_TEST_FILE, String) ==
@@ -222,11 +222,11 @@ function test_free_variables()
222222
MOI.Utilities.loadfromstring!(
223223
model,
224224
"""
225-
variables: x, y, z
226-
maxobjective: x
227-
x in ZeroOne()
228-
y in Integer()
229-
""",
225+
variables: x, y, z
226+
maxobjective: x
227+
x in ZeroOne()
228+
y in Integer()
229+
""",
230230
)
231231
MOI.write_to_file(model, LP_TEST_FILE)
232232
@test read(LP_TEST_FILE, String) ==
@@ -276,9 +276,9 @@ function test_quadratic_objective_diag()
276276
MOI.Utilities.loadfromstring!(
277277
model,
278278
"""
279-
variables: x
280-
minobjective: 1.0*x*x
281-
""",
279+
variables: x
280+
minobjective: 1.0*x*x
281+
""",
282282
)
283283
MOI.write_to_file(model, LP_TEST_FILE)
284284
@test read(LP_TEST_FILE, String) ==
@@ -296,9 +296,9 @@ function test_quadratic_objective_off_diag()
296296
MOI.Utilities.loadfromstring!(
297297
model,
298298
"""
299-
variables: x, y
300-
minobjective: 1.1 * x + 1.2 * y + 1.5*x*y + 1.3
301-
""",
299+
variables: x, y
300+
minobjective: 1.1 * x + 1.2 * y + 1.5*x*y + 1.3
301+
""",
302302
)
303303
MOI.write_to_file(model, LP_TEST_FILE)
304304
@test read(LP_TEST_FILE, String) ==
@@ -317,9 +317,9 @@ function test_quadratic_objective_complicated()
317317
MOI.Utilities.loadfromstring!(
318318
model,
319319
"""
320-
variables: x, y
321-
minobjective: 1.1 * x + 1.2 * y + -1.1 * x * x + 1.5*x*y + 1.3
322-
""",
320+
variables: x, y
321+
minobjective: 1.1 * x + 1.2 * y + -1.1 * x * x + 1.5*x*y + 1.3
322+
""",
323323
)
324324
MOI.write_to_file(model, LP_TEST_FILE)
325325
@test read(LP_TEST_FILE, String) ==
@@ -338,9 +338,9 @@ function test_quadratic_constraint_diag()
338338
MOI.Utilities.loadfromstring!(
339339
model,
340340
"""
341-
variables: x
342-
c: 1.0*x*x <= 1.4
343-
""",
341+
variables: x
342+
c: 1.0*x*x <= 1.4
343+
""",
344344
)
345345
MOI.write_to_file(model, LP_TEST_FILE)
346346
@test read(LP_TEST_FILE, String) ==
@@ -359,9 +359,9 @@ function test_quadratic_constraint_off_diag()
359359
MOI.Utilities.loadfromstring!(
360360
model,
361361
"""
362-
variables: x, y
363-
c: 1.1 * x + 1.2 * y + 1.5*x*y + 1.3 == 1.5
364-
""",
362+
variables: x, y
363+
c: 1.1 * x + 1.2 * y + 1.5*x*y + 1.3 == 1.5
364+
""",
365365
)
366366
MOI.write_to_file(model, LP_TEST_FILE)
367367
@test read(LP_TEST_FILE, String) ==
@@ -381,9 +381,9 @@ function test_quadratic_constraint_complicated()
381381
MOI.Utilities.loadfromstring!(
382382
model,
383383
"""
384-
variables: x, y
385-
c: 1.1 * x + 1.2 * y + -1.1 * x * x + 1.5*x*y + 1.3 in Interval(-1.1, 1.4)
386-
""",
384+
variables: x, y
385+
c: 1.1 * x + 1.2 * y + -1.1 * x * x + 1.5*x*y + 1.3 in Interval(-1.1, 1.4)
386+
""",
387387
)
388388
MOI.write_to_file(model, LP_TEST_FILE)
389389
@test read(LP_TEST_FILE, String) ==

test/FileFormats/NL/test_read.jl

Lines changed: 52 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -186,15 +186,15 @@ function test_parse_O()
186186
write(
187187
io,
188188
"""
189-
O0 0# can stick a comment anywhere
190-
o2
191-
v0 # can stick a comment anywhere
192-
o2
193-
v2
194-
o2
195-
v3
196-
v1
197-
""",
189+
O0 0# can stick a comment anywhere
190+
o2
191+
v0 # can stick a comment anywhere
192+
o2
193+
v2
194+
o2
195+
v3
196+
v1
197+
""",
198198
)
199199
seekstart(io)
200200
NL._parse_section(io, model)
@@ -226,11 +226,11 @@ function test_parse_x()
226226
write(
227227
io,
228228
"""
229-
x3
230-
0 1.1# can stick a comment anywhere
231-
3 2.2
232-
2 3.3 # can stick a comment anywhere
233-
""",
229+
x3
230+
0 1.1# can stick a comment anywhere
231+
3 2.2
232+
2 3.3 # can stick a comment anywhere
233+
""",
234234
)
235235
seekstart(io)
236236
NL._parse_section(io, model)
@@ -245,11 +245,11 @@ function test_parse_d()
245245
write(
246246
io,
247247
"""
248-
d3
249-
0 1.1# can stick a comment anywhere
250-
3 2.2
251-
2 3.3 # can stick a comment anywhere
252-
""",
248+
d3
249+
0 1.1# can stick a comment anywhere
250+
3 2.2
251+
2 3.3 # can stick a comment anywhere
252+
""",
253253
)
254254
seekstart(io)
255255
NL._parse_section(io, model)
@@ -328,10 +328,10 @@ function test_parse_J()
328328
write(
329329
io,
330330
"""
331-
J1 2 # can stick a comment anywhere
332-
2 1.1
333-
3 2.2 # can stick a comment anywhere
334-
""",
331+
J1 2 # can stick a comment anywhere
332+
2 1.1
333+
3 2.2 # can stick a comment anywhere
334+
""",
335335
)
336336
seekstart(io)
337337
NL._parse_section(io, model)
@@ -350,10 +350,10 @@ function test_parse_J_zeros()
350350
write(
351351
io,
352352
"""
353-
J0 2
354-
0 0
355-
1 0
356-
""",
353+
J0 2
354+
0 0
355+
1 0
356+
""",
357357
)
358358
seekstart(io)
359359
NL._parse_section(io, model)
@@ -421,10 +421,10 @@ function test_parse_G()
421421
write(
422422
io,
423423
"""
424-
G0 2 # can stick a comment anywhere
425-
2 1.1 # can stick a comment anywhere
426-
3 2.2
427-
""",
424+
G0 2 # can stick a comment anywhere
425+
2 1.1 # can stick a comment anywhere
426+
3 2.2
427+
""",
428428
)
429429
seekstart(io)
430430
NL._parse_section(io, model)
@@ -441,11 +441,11 @@ function test_parse_G_zeros()
441441
write(
442442
io,
443443
"""
444-
G0 3
445-
0 0
446-
1 0
447-
2 0
448-
""",
444+
G0 3
445+
0 0
446+
1 0
447+
2 0
448+
""",
449449
)
450450
seekstart(io)
451451
NL._parse_section(io, model)
@@ -461,14 +461,14 @@ function test_parse_O_G()
461461
write(
462462
io,
463463
"""
464-
O0 0
465-
o2
466-
v0
467-
v1
468-
G0 2
469-
0 1.1
470-
1 2.2
471-
""",
464+
O0 0
465+
o2
466+
v0
467+
v1
468+
G0 2
469+
0 1.1
470+
1 2.2
471+
""",
472472
)
473473
seekstart(io)
474474
NL._parse_section(io, model)
@@ -486,14 +486,14 @@ function test_parse_G_O()
486486
write(
487487
io,
488488
"""
489-
G0 2
490-
0 -1.1
491-
1 2.2e+01
492-
O0 0
493-
o2
494-
v0
495-
v1
496-
""",
489+
G0 2
490+
0 -1.1
491+
1 2.2e+01
492+
O0 0
493+
o2
494+
v0
495+
v1
496+
""",
497497
)
498498
seekstart(io)
499499
NL._parse_section(io, model)

0 commit comments

Comments
 (0)