import x.json2.strict

struct StructType[T] {
mut:
	val T
}

struct StructTypeAndOptionType[T] {
mut:
	val        T
	option_val ?T
}

fn test_strict_check() {
	assert strict.strict_check[StructTypeAndOptionType[string]]('{"val": "","val2": "","val3": "","val3": ""}') == strict.StructCheckResult{
		duplicates: ['val3']
		superfluous: ['val2', 'val3']
	}

	assert strict.strict_check[StructType[StructTypeAndOptionType[string]]]('{"val": {"val": "","val2": ""}}') == strict.StructCheckResult{
		duplicates: []
		superfluous: ['val.val2']
	}

	assert strict.strict_check[StructType[[]StructTypeAndOptionType[string]]]('{"val": [{"val": "","val2": ""}],[{"val": "","gdgd": "sss"}]}') == strict.StructCheckResult{
		duplicates: []
		superfluous: ['val[0].val2', 'val[1].gdgd']
	}
}
