Skip to content

Commit 35e591d

Browse files
committed
Move module definition to top level to avoid syntax error
Module definitions must be at top level, not inside @testset
1 parent 71c27dc commit 35e591d

File tree

1 file changed

+31
-31
lines changed

1 file changed

+31
-31
lines changed

test/test_llmbench_simple_integration.jl

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
1-
@testset "LLMBenchSimple Integration" begin
2-
# Create a test module directly
3-
module SimpleBenchModule
4-
using LLMBenchSimple: _setup_problem_impl, _grade_impl, PromptPlaceholder
5-
6-
# Create module-local benchmarks
7-
const BENCHMARKS = Dict{String, Any}()
1+
# Create a test module directly
2+
module SimpleBenchModule
3+
using LLMBenchSimple: _setup_problem_impl, _grade_impl, PromptPlaceholder
4+
5+
# Create module-local benchmarks
6+
const BENCHMARKS = Dict{String, Any}()
7+
8+
function __init__()
9+
# Clear any existing benchmarks
10+
empty!(BENCHMARKS)
811

9-
function __init__()
10-
# Clear any existing benchmarks
11-
empty!(BENCHMARKS)
12-
13-
# Add benchmarks manually
14-
BENCHMARKS["math1"] = (
15-
prompt_expr = :(PromptPlaceholder("What is 5 + 3?") == 8),
16-
original_expr = nothing
17-
)
18-
19-
BENCHMARKS["math2"] = (
20-
prompt_expr = :(PromptPlaceholder("What is 10 - 4?") == 6),
21-
original_expr = nothing
22-
)
23-
end
12+
# Add benchmarks manually
13+
BENCHMARKS["math1"] = (
14+
prompt_expr = :(PromptPlaceholder("What is 5 + 3?") == 8),
15+
original_expr = nothing
16+
)
2417

25-
# Create wrapper functions that use our module's benchmarks
26-
function setup_problem(workdir::String, problem_id::String="")
27-
return _setup_problem_impl(@__MODULE__, workdir, problem_id)
28-
end
29-
30-
function grade(workdir::String, transcript::String, problem_id::String="")
31-
return _grade_impl(@__MODULE__, workdir, transcript, problem_id)
32-
end
33-
end # module
18+
BENCHMARKS["math2"] = (
19+
prompt_expr = :(PromptPlaceholder("What is 10 - 4?") == 6),
20+
original_expr = nothing
21+
)
22+
end
3423

24+
# Create wrapper functions that use our module's benchmarks
25+
function setup_problem(workdir::String, problem_id::String="")
26+
return _setup_problem_impl(@__MODULE__, workdir, problem_id)
27+
end
28+
29+
function grade(workdir::String, transcript::String, problem_id::String="")
30+
return _grade_impl(@__MODULE__, workdir, transcript, problem_id)
31+
end
32+
end # module
33+
34+
@testset "LLMBenchSimple Integration" begin
3535
@testset "Module with LLMBenchSimple functions" begin
3636
# Get the module
3737
mod = Main.SimpleBenchModule

0 commit comments

Comments
 (0)