From 388ac63641e4549baf7e1f17ce87be8b393b62e0 Mon Sep 17 00:00:00 2001 From: Ben Wilber Date: Sun, 19 May 2024 15:31:25 -0400 Subject: [PATCH] Adding more examples for comparing table literals --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index bc5dec8..96f6067 100644 --- a/README.md +++ b/README.md @@ -115,6 +115,14 @@ assert(not is_valid) -- false local is_valid = valid.literal("abc", {icase = true})("ABC") assert(is_valid) -- true + +local price_table = {price = 1.00} + +local is_valid = valid.literal(price_table)({price = 1.00}) +assert(not is_valid) -- false, not the same table + +local is_valid = valid.literal(price_table)(price_table) +assert(is_valid) -- true ``` #### Parameters