package com.gzzm.lobster.llm;

import org.junit.Test;

import static org.junit.Assert.*;

public class ToolCallTest {

    @Test
    public void equalsInvocationComparesNameAndArgs() {
        ToolCall a = new ToolCall("id1", "read_file", "{\"a\":1}");
        ToolCall b = new ToolCall("id2", "read_file", "{\"a\":1}");
        ToolCall c = new ToolCall("id3", "read_file", "{\"a\":2}");
        ToolCall d = new ToolCall("id4", "write_file", "{\"a\":1}");
        assertTrue(a.equalsInvocation(b));
        assertFalse(a.equalsInvocation(c));
        assertFalse(a.equalsInvocation(d));
    }

    @Test
    public void nullOtherReturnsFalse() {
        ToolCall a = new ToolCall("id1", "x", "{}");
        assertFalse(a.equalsInvocation(null));
    }
}
