<commit_before>using BaseTestAuto: subst_expr!, split_in_subexpressions
using BaseTestAuto: build_stepwise_value_context_expr, Returned, Threw

macro stepwise_eval(expr)
    stepwiseexpr = build_stepwise_value_context_expr(expr)
    @show expr stepwiseexpr
    stepwiseexpr
end

@testset "Stepwise Expression Evaluation" begin

@testset "subst_expr! for expr not already in context" begin
    context = Any[]
    orig_ex = :( a )
    tempvar = gensym()
    ex = :(1)
    res = subst_expr!(context, orig_ex, tempvar, ex)
    @test res == tempvar
    @test length(context) == 1
end

@testset "subst_expr! for expr already in context" begin
    orig_ex = :( a )
    tempvar = gensym()
    ex = :(1)
    context = Any[(orig_ex, tempvar, ex)]
    res = subst_expr!(context, orig_ex, tempvar, ex)
    @test res == tempvar
    @test length(context) == 1 # unchanged
end<commit_msg>debug print stmt commented out<commit_after>using BaseTestAuto: subst_expr!, split_in_subexpressions
using BaseTestAuto: build_stepwise_value_context_expr, Returned, Threw

macro stepwise_eval(expr)
    stepwiseexpr = build_stepwise_value_context_expr(expr)
    #@show expr stepwiseexpr
    stepwiseexpr
end

@testset "Stepwise Expression Evaluation" begin

@testset "subst_expr! for expr not already in context" begin
    context = Any[]
    orig_ex = :( a )
    tempvar = gensym()
    ex = :(1)
    res = subst_expr!(context, orig_ex, tempvar, ex)
    @test res == tempvar
    @test length(context) == 1
end

@testset "subst_expr! for expr already in context" begin
    orig_ex = :( a )
    tempvar = gensym()
    ex = :(1)
    context = Any[(orig_ex, tempvar, ex)]
    res = subst_expr!(context, orig_ex, tempvar, ex)
    @test res == tempvar
    @test length(context) == 1 # unchanged
end
{'fraction_non_alphanumeric': 0.10135900339750849, 'fraction_numerical': 0.004530011325028313, 'mean_word_length': 4.005665722379604, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6799739', 'n_tokens_mistral': 607, 'n_tokens_neox': 592, 'n_words': 169}