Skip to content

Commit

Permalink
Align tests with new code structure
Browse files Browse the repository at this point in the history
  • Loading branch information
gwehrle committed Nov 27, 2024
1 parent 5bcc42e commit 32150ec
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/Overpass.jl
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function query(
query_or_file::String;
bbox::Bbox = nothing,
center::Center = nothing
)::String
)::String
url = @load_preference("endpoint", DEFAULT_ENDPOINT) * "interpreter"

query = get_query(query_or_file)
Expand Down Expand Up @@ -236,7 +236,7 @@ function replace_date_shortcuts(query::AbstractString)::AbstractString
for match in eachmatch(pattern, query)
# Extract captured groups
duration_value, duration_unit = match.captures
@debug "" match.captures
@debug "" match.captures

# Compute the replacement date
replacement_date = if duration_value !== nothing && duration_unit !== nothing
Expand Down
11 changes: 5 additions & 6 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,12 @@ configure!(;
@test Overpass.replace_shortcuts(
"Lorem {{ bbox \n}} {{\ncenter \n\n }} ipsum", (1, 2, 3, 4), (5, 6)) ==
"Lorem 1,2,3,4 5,6 ipsum"
end

@test_throws MissingException Overpass.replace_shortcuts(
"{{bbox}}", nothing, nothing)
@test_throws MissingException Overpass.replace_shortcuts(
"{{center}}", nothing, nothing)
@test_throws DomainError Overpass.replace_shortcuts(
"{{ custom }}", nothing, nothing)
@testset "check_remaining_shortcuts" begin
@test_throws MissingException Overpass.check_remaining_shortcuts("{{bbox}}")
@test_throws MissingException Overpass.check_remaining_shortcuts("{{center}}")
@test_throws DomainError Overpass.check_remaining_shortcuts("{{ custom }}")
end
end

Expand Down

0 comments on commit 32150ec

Please sign in to comment.