[Laszlo-checkins] r14311 - openlaszlo/trunk/test/smoke
ptw@openlaszlo.org
ptw at openlaszlo.org
Sat Jul 11 03:38:10 PDT 2009
Author: ptw
Date: 2009-07-11 03:38:07 -0700 (Sat, 11 Jul 2009)
New Revision: 14311
Modified:
openlaszlo/trunk/test/smoke/debugger.lzl
openlaszlo/trunk/test/smoke/lztext.lzl
Log:
Change 20090710-ptw-n by ptw at dueling-banjos.home on 2009-07-10 17:25:27 EDT
in /Users/ptw/OpenLaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Fix smokecheck to be platform-independent
Bugs Fixed: LPP-8321 Smokecheck failing in IE7/DHTML, problem with date format string
Technical Reviewer: hminsky (Message-ID: <8c61fad60907101950t4076e855t84603a37b1e31c05 at mail.gmail.com>)
QA Reviewer: max (pending)
Details:
Different platforms actually do Date.prototype.toString
differently, the smokecheck was not taking that into account. It
also had a stale test `canvas.runtime < 'swf7'`. I removed the
stale test and made the date formatting test independent of the
way dates are converted to strings.
Tests:
smokecheck passes in swf* and DHTML on Firefox and IE.
Modified: openlaszlo/trunk/test/smoke/debugger.lzl
===================================================================
--- openlaszlo/trunk/test/smoke/debugger.lzl 2009-07-11 08:00:07 UTC (rev 14310)
+++ openlaszlo/trunk/test/smoke/debugger.lzl 2009-07-11 10:38:07 UTC (rev 14311)
@@ -3,12 +3,7 @@
<class name="TestDebugger" extends="TestCase">
<method name="setUp">
<![CDATA[
- // SWF6 can't handle a date this far in the past.
- if (canvas.runtime < "swf7") {
- this.date = new Date();
- } else {
- this.date = new Date(Date.UTC(1969, 6, 20, 20, 17, 40, 0));
- }
+ this.date = new Date(Date.UTC(1969, 6, 20, 20, 17, 40, 0));
this.dateString = this.date.toString();
this.array = [1, 2, 3];
this.object = {one: 1, two: 'too', 3: 'three'};
@@ -168,16 +163,20 @@
assertEquals(this.dateString, Debug.formatToString('%w', this.date));
assertEquals(this.dateString.substring(0, 5), Debug.formatToString('%.5s', this.date));
// assertEquals(this.dateString.substring(0, 5), Debug.formatToString('%.5w', this.date));
- assertEquals(this.dateString, Debug.formatToString('%30s', this.date));
- assertEquals(this.dateString, Debug.formatToString('%30w', this.date));
+ assertEquals(' '.substring(0,40-this.dateString.length) + this.dateString,
+ Debug.formatToString('%40s', this.date));
+ assertEquals(' '.substring(0,40-this.dateString.length) + this.dateString,
+ Debug.formatToString('%40w', this.date));
assertEquals(' '+this.dateString.substring(0, 5), Debug.formatToString('%30.5s', this.date));
// assertEquals(' '+this.dateString.substring(0, 5), Debug.formatToString('%30.5w', this.date));
assertEquals(this.dateString, Debug.formatToString('%-s', this.date));
assertEquals(this.dateString, Debug.formatToString('%-w', this.date));
assertEquals(this.dateString.substring(0, 5), Debug.formatToString('%-.5s', this.date));
// assertEquals(this.dateString.substring(0, 5), Debug.formatToString('%-.5w', this.date));
- assertEquals(this.dateString, Debug.formatToString('%-30s', this.date));
- assertEquals(this.dateString, Debug.formatToString('%-30w', this.date));
+ assertEquals(this.dateString + ' '.substring(0,40-this.dateString.length),
+ Debug.formatToString('%-40s', this.date));
+ assertEquals(this.dateString + ' '.substring(0,40-this.dateString.length),
+ Debug.formatToString('%-40w', this.date));
assertEquals(this.dateString.substring(0, 5)+' ', Debug.formatToString('%-30.5s', this.date));
// assertEquals(this.dateString.substring(0, 5)+' ', Debug.formatToString('%-30.5w', this.date));
assertEquals('3.141592653589', Debug.formatToString('%.14s', Math.PI));
Modified: openlaszlo/trunk/test/smoke/lztext.lzl
===================================================================
--- openlaszlo/trunk/test/smoke/lztext.lzl 2009-07-11 08:00:07 UTC (rev 14310)
+++ openlaszlo/trunk/test/smoke/lztext.lzl 2009-07-11 10:38:07 UTC (rev 14311)
@@ -181,16 +181,20 @@
assertEquals(this.dateString, (textFormatTest.format('%w', this.date), textFormatTest.text));
assertEquals(this.dateString.substring(0, 5), (textFormatTest.format('%.5s', this.date), textFormatTest.text));
// assertEquals(this.dateString.substring(0, 5), (textFormatTest.format('%.5w', this.date), textFormatTest.text));
- assertEquals(this.dateString, (textFormatTest.format('%30s', this.date), textFormatTest.text));
- assertEquals(this.dateString, (textFormatTest.format('%30w', this.date), textFormatTest.text));
+ assertEquals(' '.substring(0,40-this.dateString.length) + this.dateString,
+ (textFormatTest.format('%40s', this.date), textFormatTest.text));
+ assertEquals(' '.substring(0,40-this.dateString.length) + this.dateString,
+ (textFormatTest.format('%40w', this.date), textFormatTest.text));
assertEquals(' '+this.dateString.substring(0, 5), (textFormatTest.format('%30.5s', this.date), textFormatTest.text));
// assertEquals(' '+this.dateString.substring(0, 5), (textFormatTest.format('%30.5w', this.date), textFormatTest.text));
assertEquals(this.dateString, (textFormatTest.format('%-s', this.date), textFormatTest.text));
assertEquals(this.dateString, (textFormatTest.format('%-w', this.date), textFormatTest.text));
assertEquals(this.dateString.substring(0, 5), (textFormatTest.format('%-.5s', this.date), textFormatTest.text));
// assertEquals(this.dateString.substring(0, 5), (textFormatTest.format('%-.5w', this.date), textFormatTest.text));
- assertEquals(this.dateString, (textFormatTest.format('%-30s', this.date), textFormatTest.text));
- assertEquals(this.dateString, (textFormatTest.format('%-30w', this.date), textFormatTest.text));
+ assertEquals(this.dateString + ' '.substring(0,40-this.dateString.length),
+ (textFormatTest.format('%-40s', this.date), textFormatTest.text));
+ assertEquals(this.dateString + ' '.substring(0,40-this.dateString.length),
+ (textFormatTest.format('%-40w', this.date), textFormatTest.text));
assertEquals(this.dateString.substring(0, 5)+' ', (textFormatTest.format('%-30.5s', this.date), textFormatTest.text));
// assertEquals(this.dateString.substring(0, 5)+' ', (textFormatTest.format('%-30.5w', this.date), textFormatTest.text));
assertEquals('3.141592653589', (textFormatTest.format('%.14s', Math.PI), textFormatTest.text));
More information about the Laszlo-checkins
mailing list