From 4ea0083ffcad9b73057951d871bcf2dbd855bc7c Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Sun, 10 Oct 2021 17:17:01 +0200 Subject: Refactoring to test the feel of changing a value object to a ref object in nim --- tests/field.nim | 96 +++++++++++++++++++++++++++++++-------------------------- 1 file changed, 53 insertions(+), 43 deletions(-) (limited to 'tests/field.nim') diff --git a/tests/field.nim b/tests/field.nim index 455d81f..6196d97 100644 --- a/tests/field.nim +++ b/tests/field.nim @@ -2,99 +2,109 @@ import unittest include ../src/field -func `==`(a, b: Line): bool = a.x == b.x and a.l == b.l and a.columns == b.columns -func `==`(a, b: Field): bool = a.x == b.x and a.lx == b.lx and a.y == b.y and a.ly == b.ly and a.lines == b.lines +func `==`(a, b: Field): bool = + if a.x == b.x and a.lx == b.lx and a.y == b.y and a.ly == b.ly: + for i in 0..