Skip to content

Commit 0906a88

Browse files
authoredAug 4, 2017
Fix WeakRef specs in release mode (#4790)
1 parent e85746f commit 0906a88

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed
 

‎spec/std/weak_ref_spec.cr

+3
Original file line numberDiff line numberDiff line change
@@ -79,5 +79,8 @@ describe WeakRef do
7979
State.count(:weak_foo_ref).should be > 0
8080
instances.select { |wr| wr.value.nil? }.size.should be > 0
8181
instances[-1].value.should_not be_nil
82+
83+
# Use `last` to stop the variable from being optimised away in release mode.
84+
last.to_s
8285
end
8386
end

0 commit comments

Comments
 (0)
Please sign in to comment.