From 1ad2b8b296cbb385e69e5fa5c20ec78df761a61d Mon Sep 17 00:00:00 2001 From: Stephen Ierodiaconou Date: Thu, 17 Oct 2024 14:37:18 +0200 Subject: [PATCH] A struct equality test failure --- test/struct.test.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/struct.test.rb b/test/struct.test.rb index 7b5a9c4..e06829a 100644 --- a/test/struct.test.rb +++ b/test/struct.test.rb @@ -4,6 +4,10 @@ class Person < Literal::Struct prop :name, String end +class Student < Person + prop :final_grade, Integer +end + test do person = Person.new(name: "Joel") expect(person.name) == "Joel" @@ -34,6 +38,13 @@ class Person < Literal::Struct expect(a) != b end +test do + a = Person.new(name: "Joel") + b = Student.new(name: "Joel", final_grade: 90) + + expect(a) != b +end + # Marshal doesn't work with anonymous classes class ::RootStruct < Literal::Struct prop :name, String