Commit 4c3db6b7 authored by Boris Mühmer's avatar Boris Mühmer
Browse files

change: water has no age

parent c3b08951
Loading
Loading
Loading
Loading
+1 −11
Original line number Diff line number Diff line
@@ -5,8 +5,7 @@ type Water struct {
}

const (
	water    = " " // "·" // "◌"
	waterAge = -1
	water = " "
)

// New create new water.
@@ -18,12 +17,3 @@ func New() *Water {
func (w *Water) String() string {
	return water
}

// Age always returns -1.
func (w *Water) Age() int {
	return waterAge
}

// SetAge does not set the age, because water cannot age.
func (w *Water) SetAge(a int) {
}
+0 −10
Original line number Diff line number Diff line
@@ -12,14 +12,4 @@ func TestWater(t *testing.T) {
	if ss := w.String(); ss != water {
		t.Errorf("w.String() = %s, expected %s", ss, water)
	}

	if a := w.Age(); a != waterAge {
		t.Errorf("w.Age() = %d, expected %d", a, waterAge)
	}

	n := 42
	w.SetAge(n)
	if a := w.Age(); a != waterAge {
		t.Errorf("w.Age() = %d, expected %d", a, waterAge)
	}
}