<div dir="ltr">Thanks Joe,<div><br></div><div>I will probably end up taking some of your work and execute Philippe&#39;s suggestion of testing with a dictionary. In the process of adding tests, hopefully I can improve NSDateFormatter over the next few weeks.</div><div><br></div><div>@Philippe, I did have a question:</div><div><br></div><div>Currently, many of the properties, such as locale, look like this:</div><div><br></div><div><font face="monospace, monospace">/*@NSCopying*/ public var locale: NSLocale! { willSet { _reset() } }</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="arial, helvetica, sans-serif">When previously, the looked like this:</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><div style="font-family:monospace,monospace">internal var _locale: NSLocale = NSLocale.currentLocale()</div><div style="font-family:monospace,monospace">/*@NSCopying*/ public var locale: NSLocale! {</div><div style="font-family:monospace,monospace">    get {</div><div style="font-family:monospace,monospace">        return _locale</div><div style="font-family:monospace,monospace">    }</div><div style="font-family:monospace,monospace">    set {</div><div style="font-family:monospace,monospace">        _reset()</div><div style="font-family:monospace,monospace">        _locale = newValue</div><div style="font-family:monospace,monospace">    }</div><div style="font-family:monospace,monospace">}</div><div style="font-family:monospace,monospace"><br></div><div><font face="arial, helvetica, sans-serif">Do you know a reason for this change? It seems mostly the same except the there is no default value set anymore.</font></div><div><font face="arial, helvetica, sans-serif">The pull request I&#39;m referring to that made these changes is this: <a href="https://github.com/apple/swift-corelibs-foundation/pull/234">https://github.com/apple/swift-corelibs-foundation/pull/234</a></font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">Thanks!</font></div><div><font face="arial, helvetica, sans-serif">Taylor</font></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Feb 21, 2016 at 7:17 AM, Joseph Bell <span dir="ltr">&lt;<a href="mailto:joe@iachieved.it" target="_blank">joe@iachieved.it</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Ah, I didn&#39;t even submit a pull request - that&#39;s how distracted I&#39;ve been.  Again, the code is all yours to rework or base off of if you so choose.</div><div class=""><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Feb 21, 2016 at 7:14 AM, Joseph Bell <span dir="ltr">&lt;<a href="mailto:joe@iachieved.it" target="_blank">joe@iachieved.it</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Thanks Taylor.  Unfortunately I lost time and interest in taking the idea further, I just need to figure out how to withdraw the pull request.  Feel free to take the implementation and rework per Philippe&#39;s suggestions!<div><br></div><div>Joe</div><div><br></div></div><div class="gmail_extra"><div><div><br><div class="gmail_quote">On Fri, Feb 19, 2016 at 6:35 PM, Philippe Hausler <span dir="ltr">&lt;<a href="mailto:phausler@apple.com" target="_blank">phausler@apple.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div>The problem with the change in that commit is that it is doing two different things: it is testing against python which is not the definition of Foundation’s expected output instead of testing against the expected output from the objective-c implementation. My suggestion in the pull request was to just encode a dictionary of dates to strings sampling a well known range before hand. This way it would be verifiable on both linux and Darwin as “correct” in accordance with the version of Foundation.framework that ships on Mac OS X and iOS. </div><div><br></div><div>The rest of the additions seemed pretty reasonable to me, except the case of calling popen to run a secondary script that may take extra execution time and add extra complexity other than just a dictionary of some good example date to string conversions (which actually could be utilized to reverse the test as well for scanning).</div><br><div><blockquote type="cite"><div><div><div>On Feb 19, 2016, at 4:13 PM, Taylor Franklin via swift-corelibs-dev &lt;<a href="mailto:swift-corelibs-dev@swift.org" target="_blank">swift-corelibs-dev@swift.org</a>&gt; wrote:</div><br></div></div><div><div><div><div dir="ltr"><div><div>Hello,</div><div><br></div><div>Are there any plans to integrate this commit into the main repo because I would love build off of the code within it, seeing that NSDateFormatter still seems incomplete. Additionally, the issue mentioned earlier, <a href="https://bugs.swift.org/browse/SR-208" target="_blank">https://bugs.swift.org/browse/SR-208</a>, is still valid with the latest code from master.</div><div><br></div><div>In fact, <font face="monospace, monospace">stringFromDate</font> doesn&#39;t seem to be doing much at all. Anyway, I would love to hear more from Joe or an admin on plans and progress for NSDateFormatter.</div><div><br></div><div>Thanks,</div><div>Taylor Franklin</div></div><div><br></div><div>&gt; Howdy,</div><div>&gt; </div><div>&gt; A few weeks ago I opened <a href="https://bugs.swift.org/browse/SR-208" target="_blank">https://bugs.swift.org/browse/SR-208</a> as it appears</div><div>&gt; setting the dateFormat property of NSDateFormatter has no effect. It&#39;s</div><div>&gt; been open for a while and I thought I&#39;d start looking at whether or not I</div><div>&gt; could help, and decided to first start with getting NSDateFormatter</div><div>&gt; included in TestFoundation.</div><div>&gt; </div><div>&gt; Before moving on further and issuing a PR, I would appreciate feedback on</div><div>&gt; the approach that I&#39;m taking here:</div><div>&gt; </div><div>&gt; <a href="https://github.com/iachievedit/swift-corelibs-foundation/commit/482d861127e8b78007ceaf15f6c905ac04b1e9a4" target="_blank">https://github.com/iachievedit/swift-corelibs-foundation/commit/482d861127e8b78007ceaf15f6c905ac04b1e9a4</a></div><div>&gt; </div><div>&gt; The first tests are only looking at the dateStyle property, and I&#39;ve</div><div>&gt; included tests for the various styles as they are rendered for the en_US</div><div>&gt; locale. The intent is to add support for validating additional locales in</div><div>&gt; the future.</div><div>&gt; </div><div>&gt; Since strptime doesn&#39;t appear to be available to the Glibc module I&#39;m using</div><div>&gt; a quick Python script included in Resources/ to take a format string and</div><div>&gt; render a human-friendly date.</div><div>&gt; </div><div>&gt; At the moment I know there is a discrepancy between what NSDateFormatter</div><div>&gt; and the python driver can emit, the python script is currently adjusting to</div><div>&gt; my timezone and not using UTC, but that will be fixed before a PR is</div><div>&gt; issued. I&#39;ll also add the timeStyle property and then continue to add</div><div>&gt; tests.</div><div>&gt; </div><div>&gt; Thoughts and comments most welcome, and Happy New Year.</div><div>&gt; </div><div>&gt; Joe</div><div>&gt; </div><div>&gt; </div><div>&gt; </div>







</div></div></div>
_______________________________________________<br>swift-corelibs-dev mailing list<br><a href="mailto:swift-corelibs-dev@swift.org" target="_blank">swift-corelibs-dev@swift.org</a><br><a href="https://lists.swift.org/mailman/listinfo/swift-corelibs-dev" target="_blank">https://lists.swift.org/mailman/listinfo/swift-corelibs-dev</a><br></div></blockquote></div><br></div></blockquote></div><br><br clear="all"><div><br></div></div></div><span><font color="#888888">-- <br><div><div dir="ltr">---<div><a href="http://dev.iachieved.it/iachievedit/" target="_blank">http://dev.iachieved.it/iachievedit/</a></div><div>@iachievedit</div></div></div>
</font></span></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div><div dir="ltr">---<div><a href="http://dev.iachieved.it/iachievedit/" target="_blank">http://dev.iachieved.it/iachievedit/</a></div><div>@iachievedit</div></div></div>
</div>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><b><font face="arial, helvetica, sans-serif" size="2">Taylor Franklin</font></b><div>iOS Developer | IBM Mobile Innovation Lab</div><div>972-207-2051  | <a href="mailto:taylorleefranklin@gmail.com" target="_blank">taylorleefranklin@gmail.com</a></div><div><i>Blog</i>: <a href="http://taylorfranklin.me/" style="color:rgb(17,85,204);font-size:small" target="_blank">http://taylorfranklin.me</a> | <i>LinkedIn</i>: <a href="https://www.linkedin.com/in/taylorfranklin" target="_blank">https://www.linkedin.com/in/taylorfranklin</a></div></div></div></div></div>
</div></div></div>