cetra3 commented on code in PR #10352:
URL: https://github.com/apache/arrow-rs/pull/10352#discussion_r3600050034


##########
parquet-variant/tests/proptest.rs:
##########
@@ -0,0 +1,237 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+//! Property tests for variant decoding and validation.
+//!
+//! Two families of invariant are checked here:
+//!
+//! 1. **Untrusted input.** [`Variant::try_new`] and 
[`VariantMetadata::try_new`] are fallible APIs
+//!    over bytes read from a file. They must return `Err` on malformed input 
rather than panic, and
+//!    anything they accept must then be panic-free to access, as 
[`VariantMetadata`] documents.
+//! 2. **Writer/reader agreement.** Anything [`VariantBuilder`] emits must 
validate and read back
+//!    unchanged, whatever order the dictionary happens to be in.
+//!
+//! The generators deliberately produce degenerate shapes: empty field names, 
multi-byte UTF-8, and
+//! interior NULs. This matters more than the properties themselves -- 
narrowing `arb_key` to
+//! `[a-z]+` makes these tests pass against code with known bugs.
+//!
+//! Objects are generated structurally rather than as random bytes: random 
bytes are rejected by
+//! header and offset validation long before reaching the object logic, so 
they never exercise it.
+
+use parquet_variant::{Variant, VariantBuilder, VariantMetadata};
+use proptest::prelude::*;
+use std::collections::HashSet;
+
+/// The empty metadata dictionary.
+const EMPTY_METADATA: &[u8] = &[1, 0, 0];

Review Comment:
   Done!



##########
parquet-variant/src/variant/object.rs:
##########


Review Comment:
   Done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to