Skip to content

Commit f744360

Browse files
committed
Final touches to formatting settings and template (for now).
1 parent 26db4dd commit f744360

3 files changed

Lines changed: 18 additions & 17 deletions

File tree

bin/generate_tests.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@
4141
from textwrap import wrap
4242
from typing import Any, Dict, List, NoReturn, Union
4343

44-
import juliacall
45-
from juliacall import Main as jl
46-
4744

4845
# Tomli was subsumed into Python 3.11.x, but was renamed to tomllib.
4946
# This avoids ci failures for Python < 3.11.2.
@@ -287,13 +284,8 @@ def format_file(path: Path) -> NoReturn:
287284
Runs JuliaFormatter auto-formatter on file at path
288285
"""
289286

290-
#below is the juliacall method
291-
# jl.seval("using JuliaFormatter")
292-
# style = jl.JuliaFormatter.YASStyle()
293-
# jl.JuliaFormatter.format_file(str(path), style, verbose=True, remove_extra_newlines=True)
294-
295287
# This uses subprocess to shell out and call jlfmt from the command line
296-
check_call(["jlfmt", path, "-i", "-v", "--style=yas"])
288+
check_call(["jlfmt", path, "-i", "-v", "--style=yas", "--remove_extra_newlines"])
297289

298290

299291
def check_template(slug: str, tests_path: Path, tmpfile: Path):

exercises/practice/acronym/.meta/template.j2

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77
@testset "{{ case["description"]}}" begin
88
@test acronym("{{ case["input"]["phrase"] }}") == "{{ case["expected"] }}"
99
end
10-
{%- endmacro %}
11-
{%- for case in cases -%}
10+
{% endmacro %}
11+
12+
{% for case in cases -%}
1213
{{ test_case(case) }}
13-
{%- endfor %}
14-
end
14+
{% endfor %}
15+
end
Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# These tests are auto-generated with test data from:
22
# https://github.com/exercism/problem-specifications/tree/main/exercises/acronym/canonical-data.json
3-
# File last updated on 2026-04-24
4-
3+
# File last updated on 2026-04-26
54

65
using Test
76

@@ -11,28 +10,37 @@ include("acronym.jl")
1110
@testset "basic" begin
1211
@test acronym("Portable Network Graphics") == "PNG"
1312
end
13+
1414
@testset "lowercase words" begin
1515
@test acronym("Ruby on Rails") == "ROR"
1616
end
17+
1718
@testset "punctuation" begin
1819
@test acronym("First In, First Out") == "FIFO"
1920
end
21+
2022
@testset "all caps word" begin
2123
@test acronym("GNU Image Manipulation Program") == "GIMP"
2224
end
25+
2326
@testset "punctuation without whitespace" begin
2427
@test acronym("Complementary metal-oxide semiconductor") == "CMOS"
2528
end
29+
2630
@testset "very long abbreviation" begin
27-
@test acronym("Rolling On The Floor Laughing So Hard That My Dogs Came Over And Licked Me") == "ROTFLSHTMDCOALM"
31+
@test acronym("Rolling On The Floor Laughing So Hard That My Dogs Came Over And Licked Me") ==
32+
"ROTFLSHTMDCOALM"
2833
end
34+
2935
@testset "consecutive delimiters" begin
3036
@test acronym("Something - I made up from thin air") == "SIMUFTA"
3137
end
38+
3239
@testset "apostrophes" begin
3340
@test acronym("Halley's Comet") == "HC"
3441
end
42+
3543
@testset "underscore emphasis" begin
3644
@test acronym("The Road _Not_ Taken") == "TRNT"
3745
end
38-
end
46+
end

0 commit comments

Comments
 (0)