CodeSampleX

サンプル

Prove that non-string hash keys can disappear silently when JSON stringifies keys before parsing.

sha256:ba97e97ecda15df826536164d19fb790db2821d0d91ae3dfb2f344205cfb43a0

PUBLISHED L3_CONTRACT_PASS MIT-0

ケース

ゴール
Prove that non-string hash keys can disappear silently when JSON stringifies keys before parsing. HOW
パッケージ
json 2.9.1
環境
ruby
作成日
2026-08-17T01:17:10Z

よくある思い込み

A Hash with keys 1 and '1' should preserve both entries after a round-trip because the two keys are different in Ruby.

このサンプルの作者が、ここで開発者やモデルが期待するであろうこととして記録したもの。下の契約が実際に実行されたものだ。

コントラクト

ファイル

検証済みアーティファクトをダウンロード (tar.gz) — 契約が実行された正確なバイト列

オリジンシーダー

csx-seed

検証レシート