<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body>
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p>Hi Marcel,</p>
<p><br>
</p>
<p>> <span style="font-size: 12pt;">The use of "Preferences" would add a dependency to System, for example.</span></p>
<div><br>
</div>
<p></p>
<div id="Signature">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size: 12pt; color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;">
<div name="divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
<div>
<div class="_rp_T4" id="Item.MessagePartBody">
<div class="_rp_U4 ms-font-weight-regular ms-font-color-neutralDark rpHighlightAllClass rpHighlightBodyClass" id="Item.MessageUniqueBody" style="font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif,serif,EmojiFont">
<div dir="ltr">
<div id="divtagdefaultwrapper"><font face="Calibri,Helvetica,sans-serif,EmojiFont,Apple Color Emoji,Segoe UI Emoji,NotoColorEmoji,Segoe UI Symbol,Android Emoji,EmojiSymbols">
<div id="Signature">
<div style="margin:0px"><font style="font-family:Calibri,Arial,Helvetica,sans-serif,serif,EmojiFont">
<div><font size="3" color="black"><span style="font-size:12pt"><a href="http://www.hpi.de/" target="_blank" rel="noopener noreferrer" id="LPNoLP"><font size="2"><span id="LPlnk909538"><font color="#757B80"></font></span></font></a></span></font></div>
</font></div>
</div>
</font></div>
</div>
</div>
</div>
<div class="_rp_T4" id="Item.MessagePartBody">I think this is bearable because Preferences is indeed a manager for preferences of all kinds. Also, from a practical perspective, I doubt that we will be ever able to unload System from a Squeak image. :-)</div>
<div class="_rp_T4" id="Item.MessagePartBody"><br>
</div>
<div class="_rp_T4" id="Item.MessagePartBody">> <span style="font-size: 12pt;">In this case, a "during:" mechanism would not work because #setUp and #tearDown are called by the SUnit "framework" :-) Maybe SUnit could provide some configurable way for this.</span>
<div><br>
</div>
<div>Yeah, that's a common problem ... I could imagine two possible solutions for this problem:</div>
<div><br>
</div>
<div>
<ol style="margin-bottom: 0px; margin-top: 0px;">
<li>Override #performTest and wrap it with all your executeAround-logic. I do this quite often, but it does not really feel elegant to me ...</li><li>We could add something like #wrap: to the TestCase interface. Example:<br>
<br>
setUp<br>
<br>
    super setUp.<br>
    <br>
<b>    self wrap: [:block | Preferences restoreAfter: block].</b><br>
    Model <span>useColorfulWindows: true.<br>
    ...<br>
<br>
See also Context >> #wrap: here: <a href="https://github.com/LinqLover/SimulationStudio/blob/5a0ddad75130e947a270bc6dd0ab7e3b0aa4e562/packages/SimulationStudio-Base.package/Context.extension/instance/wrap..st" class="OWAAutoLink" id="LPlnk619940" previewremoved="true">https://github.com/LinqLover/SimulationStudio/blob/5a0ddad75130e947a270bc6dd0ab7e3b0aa4e562/packages/SimulationStudio-Base.package/Context.extension/instance/wrap..st</a><br>
<br>
What do you think, can I send something like this to the inbox? :-)</span></li></ol>
<div><br>
</div>
</div>
<div>> <span style="font-size: 12pt;">In System-ct.1119, I do not like the overuse of symbols and meta-programming in client code (e.g. a test's #setUp). In preferences, the entire construction of a key for pragma preferences feels like an ugly hack.</span>
<div><br>
</div>
<div>Agreed. :-) At least these symbols are a private implementation detail of Preferences.</div>
<div><br>
</div>
<div>> <span>SUnit could just snapshot all their values before the test and reset them after.</span></div>
<div><span><br>
</span></div>
<div><span>Interesting approach. :-) But I think we could only do this if all preferences were consistently implemented with dynamic scoping - it would be too confusing if you edited your preferences while a test debugger remains opened in your image, and after
 closing the debugger, your changes to these preferences were lost. This, again, would require a stronger framework for managing preferences (one that does not delegate the control of their values to the defining classes), so in the end, I guess this is not
 feasible for us without major breaking changes ...</span></div>
<div><span><br>
</span></div>
<div><span>Best,</span></div>
<div><span>Christoph</span></div>
</div>
</div>
</div>
<div><font size="2" color="#808080"></font></div>
</div>
</div>
</div>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>Von:</b> Squeak-dev <squeak-dev-bounces@lists.squeakfoundation.org> im Auftrag von Taeumel, Marcel<br>
<b>Gesendet:</b> Montag, 26. April 2021 18:36:35<br>
<b>An:</b> squeak-dev<br>
<b>Betreff:</b> Re: [squeak-dev] The Trunk: MorphicTests-nice.75.mcz</font>
<div> </div>
</div>
<div>
<div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: #000000;text-align: left" dir="ltr">
Hi Christoph.
<div><br>
</div>
<div>> <span style="font-family: Calibri, Helvetica, sans-serif;font-size: 16px">we already have #</span><span style="font-family: Calibri, Helvetica, sans-serif;font-size: 16px">setPreference:toValue:during: on Preferences class</span></div>
<div><span style="font-family: Calibri, Helvetica, sans-serif;font-size: 16px"><br>
</span></div>
<div><span style="font-family: Calibri, Helvetica, sans-serif;font-size: 16px">Hmm... I think that I am reluctant to use the "Preferences" interface for pragma preferences, which have the benefit of directly showing the domain they are used for. The use of
 "Preferences" would add a dependency to System, for example.</span></div>
<div><span style="font-family: Calibri, Helvetica, sans-serif;font-size: 16px"><br>
</span></div>
<div><span style="font-family: Calibri, Helvetica, sans-serif;font-size: 16px">In this case, a "during:" mechanism would not work because #setUp and #tearDown are called by the SUnit "framework" :-) Maybe SUnit could provide some configurable way for this.</span></div>
<div><span style="font-family: Calibri, Helvetica, sans-serif;font-size: 16px"><br>
</span></div>
<div><span style="font-family: Calibri, Helvetica, sans-serif;font-size: 16px">In System-ct.1119, I do not like the overuse of symbols and meta-programming in client code (e.g. a test's #setUp). In preferences, the entire construction of a key for pragma preferences
 feels like an ugly hack.</span></div>
<div><span style="font-family: Calibri, Helvetica, sans-serif;font-size: 16px"><br>
</span></div>
<div><span style="font-family: Calibri, Helvetica, sans-serif;font-size: 16px">Hmm... actually, pragma preferences and other Preferences are easily accessible. SUnit could just snapshot all their values before the test and reset them after. The values are mostly
 primitive, immutable objects. An extra reference to them would suffice. A test's #setUp code could do what it wants to do and then rely on the implicit reset of all preferences in #tearDown. Hmm....</span></div>
<div><span style="font-family: Calibri, Helvetica, sans-serif;font-size: 16px"><br>
</span></div>
<div><span style="font-family: Calibri, Helvetica, sans-serif;font-size: 16px">Best,</span></div>
<div><span style="font-family: Calibri, Helvetica, sans-serif;font-size: 16px">Marcel</span></div>
<div><span style="font-family: Calibri, Helvetica, sans-serif;font-size: 16px"><br>
</span></div>
<div class="mb_sig"></div>
<blockquote class="history_container" type="cite" style="border-left-style: solid;border-width: 1px;margin-top: 20px;margin-left: 0px;padding-left: 10px;min-width: 500px">
<p style="color: #AAAAAA; margin-top: 10px;">Am 25.04.2021 20:23:27 schrieb Thiede, Christoph <christoph.thiede@student.hpi.uni-potsdam.de>:</p>
<div style="font-family:Arial,Helvetica,sans-serif">
<div id="divtagdefaultwrapper" style="font-size: 12pt;color: #000000;font-family: Calibri,Helvetica,sans-serif" dir="ltr">
<p>Hi Marcel,</p>
<p><br>
</p>
<p>we already have #<span>setPreference:toValue:during: on Preferences class. I also had to remember this proposal + discussion:
<a href="http://forum.world.st/The-Inbox-System-ct-1119-mcz-td5106025.html" class="OWAAutoLink">
The Inbox: System-ct.1119.mcz</a> Your counter-proposal with the preferences sandbox also sounds interesting, we could do this as well.</span></p>
<p><span><br>
</span></p>
<p><span>(Just now, I am wondering whether preferences should be process-local ... But that's enough stuff for its own discussion. :-))</span></p>
<p><span><br>
</span></p>
<p><span>Best,</span></p>
<p><span>Christoph</span></p>
<div id="Signature">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size: 12pt;color: rgb(0, 0, 0);font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols">
<div name="divtagdefaultwrapper" style="font-family: Calibri,Arial,Helvetica,sans-serif;font-size: ;margin: 0">
<div>
<div class="_rp_T4" id="Item.MessagePartBody">
<div class="_rp_U4 ms-font-weight-regular ms-font-color-neutralDark rpHighlightAllClass rpHighlightBodyClass" id="Item.MessageUniqueBody" style="font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif,serif,EmojiFont">
<div dir="ltr">
<div id="divtagdefaultwrapper"><span style="font-family: Calibri,Helvetica,sans-serif,EmojiFont,Apple Color Emoji,Segoe UI Emoji,NotoColorEmoji,Segoe UI Symbol,Android Emoji,EmojiSymbols">
<div id="Signature">
<div style="margin:0px"><span style="">
<div><font size="3" color="black"><span style="font-size: 12pt"><a href="http://www.hpi.de/" target="_blank" rel="noopener noreferrer" id="LPNoLP"><font size="2"><span id="LPlnk909538"><font color="#757B80"></font></span></font></a></span></font></div>
</span></div>
</div>
</span></div>
</div>
</div>
</div>
</div>
<div><span style="font-size: 10pt;color: #808080"></span></div>
</div>
</div>
</div>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><span style="font-family: Calibri, sans-serif;color: #000000"><b>Von:</b> Squeak-dev <squeak-dev-bounces@lists.squeakfoundation.org> im Auftrag von Taeumel, Marcel<br>
<b>Gesendet:</b> Donnerstag, 15. April 2021 09:39:57<br>
<b>An:</b> squeak-dev<br>
<b>Betreff:</b> Re: [squeak-dev] The Trunk: MorphicTests-nice.75.mcz</span>
<div> </div>
</div>
<div>
<div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: #000000;text-align: left" dir="ltr">
Hi Nicolas.
<div><br>
</div>
<div>Thanks. We might want to think about a more generic way to specify system-wide preferences for tests. Maybe a new feature in TestCase (or SUnit). While I would never want to change such preferences in a specific test, I also see that the setUp-way (with
 that extra "reset" instVar) is quite cumbersome.</div>
<div><br>
</div>
<div>Best,</div>
<div>Marcel</div>
<div class="mb_sig"></div>
<blockquote class="history_container" type="cite" style="border-left-style: solid;border-width: 1px;margin-top: 20px;margin-left: 0px;padding-left: 10px;min-width: 500px">
<p style="color: #AAAAAA; margin-top: 10px;">Am 14.04.2021 19:14:23 schrieb commits@source.squeak.org <commits@source.squeak.org>:</p>
<div style="font-family:Arial,Helvetica,sans-serif">Nicolas Cellier uploaded a new version of MorphicTests to project The Trunk:<br>
http://source.squeak.org/trunk/MorphicTests-nice.75.mcz<br>
<br>
==================== Summary ====================<br>
<br>
Name: MorphicTests-nice.75<br>
Author: nice<br>
Time: 14 April 2021, 7:14:06.997889 pm<br>
UUID: d87c50dd-4e44-5242-9120-37e0452ca781<br>
Ancestors: MorphicTests-eem.74<br>
<br>
Fix loss of useRetractableScrollBars preference<br>
<br>
=============== Diff against MorphicTests-eem.74 ===============<br>
<br>
Item was changed:<br>
----- Method: TableLayoutTest>>setUp (in category 'running') -----<br>
setUp<br>
<br>
super setUp.<br>
- <br>
reset := {<br>
([:enable | [self useRetractableScrollBars: enable]]<br>
value: self useRetractableScrollBars)<br>
+ }.<br>
+ self useRetractableScrollBars: false!<br>
- in: [:block | self useRetractableScrollBars: false].<br>
- }.!<br>
<br>
<br>
</div>
</blockquote>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</body>
</html>