feat: structured errors with hint, ToolResult, cursor pagination
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01At3V6SjwbMe6eMzVGW3Hs7
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace LIT\MCP\Tests\Unit\Abilities;
|
||||
|
||||
use LIT\MCP\Abilities\JsonMap;
|
||||
use LIT\MCP\Abilities\Rev;
|
||||
use LIT\MCP\Tests\Unit\TestCase;
|
||||
use stdClass;
|
||||
|
||||
final class RevAndJsonMapTest extends TestCase
|
||||
{
|
||||
public function testRevIsShortDeterministicAndContentSensitive(): void
|
||||
{
|
||||
self::assertMatchesRegularExpression('/^[0-9a-f]{12}$/', Rev::of('abc'));
|
||||
self::assertSame(Rev::of('abc'), Rev::of('abc'));
|
||||
self::assertNotSame(Rev::of('abc'), Rev::of('abd'));
|
||||
}
|
||||
|
||||
public function testEmptyMapBecomesJsonObject(): void
|
||||
{
|
||||
self::assertInstanceOf(stdClass::class, JsonMap::of([]));
|
||||
self::assertSame('{}', json_encode(JsonMap::of([])));
|
||||
self::assertSame(['a' => 1], JsonMap::of(['a' => 1]));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user