db620d33df
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
dotnet-build-and-test / dotnet-test-functions (push) Has been cancelled
dotnet-build-and-test / paths-filter (push) Has been cancelled
dotnet-build-and-test / dotnet-build (Debug, windows-latest, net9.0) (push) Has been cancelled
dotnet-build-and-test / dotnet-build (Release, ubuntu-latest, net10.0) (push) Has been cancelled
dotnet-build-and-test / dotnet-build (Release, ubuntu-latest, net8.0) (push) Has been cancelled
dotnet-build-and-test / dotnet-build (Release, windows-latest, net472) (push) Has been cancelled
dotnet-build-and-test / dotnet-test (Release, integration, true, ubuntu-latest, net10.0) (push) Has been cancelled
dotnet-build-and-test / dotnet-test (Release, integration, true, windows-latest, net472) (push) Has been cancelled
dotnet-build-and-test / dotnet-foundry-hosted-it (push) Has been cancelled
dotnet-build-and-test / dotnet-build-and-test-check (push) Has been cancelled
dotnet-build-and-test / Integration Test Report (push) Has been cancelled
37 lines
1.4 KiB
Python
37 lines
1.4 KiB
Python
# Copyright (c) Microsoft. All rights reserved.
|
|
|
|
"""Tests for GAIA benchmark implementation."""
|
|
|
|
from agent_framework_lab_gaia import gaia_scorer
|
|
|
|
|
|
class TestGAIAScorer:
|
|
"""Test the GAIA scoring function."""
|
|
|
|
def test_numeric_exact_match(self):
|
|
"""Test numeric exact matching."""
|
|
assert gaia_scorer("42", "42") is True
|
|
assert gaia_scorer("42.0", "42") is True
|
|
assert gaia_scorer("42", "42.0") is True
|
|
assert gaia_scorer("42", "43") is False
|
|
|
|
def test_string_normalization(self):
|
|
"""Test string normalization and matching."""
|
|
assert gaia_scorer("Hello World", "hello world") is True
|
|
assert gaia_scorer("Hello, World!", "helloworld") is True
|
|
assert gaia_scorer("test", "TEST") is True
|
|
assert gaia_scorer("test", "different") is False
|
|
|
|
def test_list_matching(self):
|
|
"""Test list matching with comma/semicolon separation."""
|
|
assert gaia_scorer("1,2,3", "1,2,3") is True
|
|
assert gaia_scorer("1; 2; 3", "1,2,3") is True
|
|
assert gaia_scorer("apple,banana", "apple,banana") is True
|
|
assert gaia_scorer("1,2,3", "1,2,4") is False
|
|
assert gaia_scorer("1,2", "1,2,3") is False
|
|
|
|
def test_none_handling(self):
|
|
"""Test handling of None values."""
|
|
assert gaia_scorer("None", "test") is False
|
|
assert gaia_scorer("", "test") is False
|