From f707b6c4c642ee4427da3067f3e2f2593f74cb7a Mon Sep 17 00:00:00 2001 From: Laurence Tratt Date: Tue, 16 Jun 2020 10:47:08 +0100 Subject: [PATCH] Test that instance fields across class and superclass work correctly. As it so happens, yksom already respects this new facet of the SOM spec (https://github.com/SOM-st/SOM/issues/44), so the test alone is sufficient. --- .../inst_var_at_put_superclass/test.som | 25 +++++++++++++++++++ .../inst_var_at_put_superclass/test_super.som | 10 ++++++++ 2 files changed, 35 insertions(+) create mode 100644 lang_tests/inst_var_at_put_superclass/test.som create mode 100644 lang_tests/inst_var_at_put_superclass/test_super.som diff --git a/lang_tests/inst_var_at_put_superclass/test.som b/lang_tests/inst_var_at_put_superclass/test.som new file mode 100644 index 00000000..b06117ef --- /dev/null +++ b/lang_tests/inst_var_at_put_superclass/test.som @@ -0,0 +1,25 @@ +" +VM: + status: success + stdout: + 1 + 2 + 4 + 3 +" + +test = test_super ( + | d c | + + run = ( + self instVarAt: 1 put: 1. + self instVarAt: 2 put: 2. + self instVarAt: 3 put: 3. + self instVarAt: 4 put: 4. + + a println. + b println. + c println. + d println. + ) +) diff --git a/lang_tests/inst_var_at_put_superclass/test_super.som b/lang_tests/inst_var_at_put_superclass/test_super.som new file mode 100644 index 00000000..7b3eada6 --- /dev/null +++ b/lang_tests/inst_var_at_put_superclass/test_super.som @@ -0,0 +1,10 @@ +test_super = ( + | a b | + + f = ( + (self instVarAt: 1) println. + (self instVarAt: 2) println. + (self instVarAt: 3) println. + (self instVarAt: 4) println. + ) +)