<commit_before>if not LibStub then return end

local AG = LibStub:GetLibrary('AnimationGroup-1.0')
if not AG then return end

local tests = {}

local frame = CreateFrame('Frame')
frame:SetPoint('CENTER', UIParent, 'CENTER', 0, 0)
frame:SetWidth(128)
frame:SetHeight(128)

local tex = frame:CreateTexture('ARTWORK')
tex:SetAllPoints(frame)
tex:SetBlendMode('ADD')
tex:SetTexture('Interface\\Icons\\Ability_Warrior_WarCry')
frame:Show()

local ag

local Setup = function()
    ag = frame:CreateAnimationGroup()
    ag:SetLooping('BOUNCE')
end
table.insert(tests, Setup)

local TranslationScaleRotationAlphaAnimation = function()
    local translation = ag:CreateAnimation('Translation')
    translation:SetOffset(100, 100)
    translation:SetDuration(1)
    translation:SetSmoothing('OUT')

    local scale = ag:CreateAnimation('Scale')
    scale:SetScale(.5, .5)
    scale:SetDuration(1)
    scale:SetSmoothing('OUT')

    local rotation = ag:CreateAnimation('Rotation')
    rotation:SetDegrees(0)
    rotation:SetDuration(2)
    rotation:SetSmoothing('INOUT')

    local alpha = ag:CreateAnimation('Alpha')
    alpha:SetChange(-0.9)
    alpha:SetDuration(3)
    alpha:SetSmoothing('OUT')

    ag:Play()
end
table.insert(tests, TranslationScaleRotationAlphaAnimation)

local NewScaleAnimation = function()
    local frame = CreateFrame('Frame')
    frame:SetPoint('CENTER', UIParent, 'CENTER', -200, 0)
    frame:SetWidth(64)
    frame:SetHeight(64)

    local tex = frame:CreateTexture('ARTWORK')
    tex:SetAllPoints(frame)
    tex:SetBlendMode('ADD')
    tex:SetTexture('Interface\\Icons\\INV_Misc_Pelt_Bear_Ruin_02')
    frame:Show()

    local ag = frame:CreateAnimationGroup()
    ag:SetLooping('BOUNCE')

    local scale = ag:CreateAnimation('Scale')
    scale:SetScale(1.5, 1.5)
    scale:SetDuration(2.5)
    scale:SetSmoothing('OUT')

    ag:Play()
end
table.insert(tests, NewScaleAnimation)

local function OnEvent()
    for _, test in next, tests do
        test()
    end
end

frame:RegisterEvent('UPDATE_INSTANCE_INFO')
frame:SetScript('OnEvent', OnEvent)
<commit_msg>Reworks test setup<commit_after>if not LibStub then return end

local AG = LibStub:GetLibrary('AnimationGroup-1.0')
if not AG then return end

local tests = {}

local frame = CreateFrame('Frame')
local tex
local ag

local Setup = function()
    frame = CreateFrame('Frame')
    frame:SetWidth(128)
    frame:SetHeight(128)
    frame:SetPoint('CENTER', UIParent, 'CENTER', 0, 0)

    tex = frame:CreateTexture('ARTWORK')
    tex:SetAllPoints(frame)
    tex:SetBlendMode('ADD')
    frame:Show()

    ag = frame:CreateAnimationGroup()
    ag:SetLooping('BOUNCE')
end

local TranslationScaleRotationAlphaAnimation = function()
    frame:ClearAllPoints()
    frame:SetPoint('CENTER', UIParent, 'CENTER', 200, 0)

    tex:SetTexture('Interface\\Icons\\Ability_Warrior_WarCry')

    local translation = ag:CreateAnimation('Translation')
    translation:SetOffset(100, 100)
    translation:SetDuration(1)
    translation:SetSmoothing('OUT')

    local scale = ag:CreateAnimation('Scale')
    scale:SetScale(.5, .5)
    scale:SetDuration(1)
    scale:SetSmoothing('OUT')

    local rotation = ag:CreateAnimation('Rotation')
    rotation:SetDegrees(90)
    rotation:SetDuration(2)
    rotation:SetSmoothing('INOUT')

    local alpha = ag:CreateAnimation('Alpha')
    alpha:SetChange(-0.9)
    alpha:SetDuration(3)
    alpha:SetSmoothing('OUT')

    ag:Play()
end
table.insert(tests, Setup)
table.insert(tests, TranslationScaleRotationAlphaAnimation)

local NewScaleAnimation = function()
    frame:ClearAllPoints()
    frame:SetPoint('CENTER', UIParent, 'CENTER', 0, 250)

    tex:SetTexture('Interface\\Icons\\INV_Misc_Pelt_Bear_Ruin_02')

    local scale = ag:CreateAnimation('Scale')
    scale:SetScale(-2, -2)
    scale:SetDuration(2.5)
    scale:SetSmoothing('OUT')

    ag:Play()
end
table.insert(tests, Setup)
table.insert(tests, NewScaleAnimation)

local OrderAnimations = function()
    frame:ClearAllPoints()
    frame:SetPoint('CENTER', UIParent, 'CENTER', -250, 0)

    tex:SetTexture('Interface\\Icons\\Spell_Holy_InnerFire')

    local scale = ag:CreateAnimation('Scale')
    scale:SetScale(1.5, 1.5)
    scale:SetDuration(1)
    scale:SetSmoothing('OUT')
    scale:SetOrder(0)

    local rotation = ag:CreateAnimation('Rotation')
    rotation:SetDegrees(180)
    rotation:SetDuration(1)
    rotation:SetSmoothing('OUT')
    rotation:SetOrder(1)

    local alpha = ag:CreateAnimation('Alpha')
    alpha:SetChange(0.5)
    alpha:SetDuration(1)
    alpha:SetSmoothing('OUT')
    alpha:SetOrder(2)

    ag:Play()
end
table.insert(tests, Setup)
table.insert(tests, OrderAnimations)

local function OnEvent()
    for _, test in next, tests do
        test()
    end
    tests = nil
end

frame:RegisterEvent('UPDATE_INSTANCE_INFO')
frame:SetScript('OnEvent', OnEvent)

{'fraction_non_alphanumeric': 0.12935836599958736, 'fraction_numerical': 0.020631318341242006, 'mean_word_length': 4.81294964028777, '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': '5947498', 'n_tokens_mistral': 1651, 'n_tokens_neox': 1574, 'n_words': 295}