mirror of
https://github.com/vxcontrol/pentagi.git
synced 2026-07-21 08:15:23 -04:00
[PR #231] [MERGED] test: add unit tests for schema package JSON Schema validation #252
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/vxcontrol/pentagi/pull/231
Author: @mason5052
Created: 3/31/2026
Status: ✅ Merged
Merged: 4/2/2026
Merged by: @asdek
Base:
main← Head:test/schema-validation📝 Commits (2)
cc0260btest: add unit tests for schema package JSON Schema validation8ddc25ftest: add failure-path coverage for schema validation📊 Changes
1 file changed (+527 additions, -0 deletions)
View changed files
➕
backend/pkg/schema/schema_test.go(+527 -0)📄 Description
What
Add unit test coverage for the
pkg/schemapackage JSON Schema Draft 7 validation.Why
The schema package implements JSON Schema validation used for tool input/output validation across PentAGI. It had no test coverage despite handling schema compilation, document validation, database serialization, and custom JSON marshaling with extended properties.
Tests Added (schema_test.go)
TestSchemaValidTestSchemaGetValidatorTestSchemaValidateStringTestSchemaValidateBytesTestSchemaValidateGoTestSchemaValueScanTestTypeMarshalJSONTestTypeUnmarshalJSONTestSchemaValidateObjectWithEnumTestSchemaValidateWithPatternTestSchemaValidateArrayTestScanFromJSONTest Approach
t.Parallel()for fast executionVerification
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.