[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lmi] wx_test_input_sequences.cpp
From: |
Greg Chicares |
Subject: |
Re: [lmi] wx_test_input_sequences.cpp |
Date: |
Sun, 14 Dec 2014 15:12:12 +0000 |
User-agent: |
Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 |
On 2014-12-14 13:49, Vadim Zeitlin wrote:
> On Fri, 12 Dec 2014 15:17:49 +0000 Greg Chicares <address@hidden> wrote:
>
> GC> // ERASE THIS BLOCK COMMENT WHEN IMPLEMENTATION COMPLETE. The block
> GC> // comment below changes the original specification, and does not
> GC> // yet describe the present code. Desired changes:
> GC> // - Hard code the sequences; get rid of 'InputSequences.cns'.
>
> All the sequences in InputSequences.cns file I have are also present in
> sequence_input.html. However there is one sequence which is present in the
> latter but not in the former: "annual; monthly". I assume that we should
> test this sequence as well
Yes, we should. Sequences may allow only numbers, only keywords, or both,
and those represent different paths through the code. At a quick glance,
it appears that this is the sole keywords-only field in the manual here:
http://www.nongnu.org/lmi/sequence_input.html
so adding it is beneficial.
And that leads to another issue: there is no numbers-only field on that
page. That's okay for the user manual (where it may be regarded as a
degenerate case of a numbers-and-keywords field), but for the GUI test
we should add a numbers-only field to cover that code path too. I'll
propose one below.
> GC> /// Validate a variety of input sequences in the GUI input dialog.
> GC> ///
> GC> /// Test a broad variety of input sequences. For now, use the set in
> GC> /// the user manual:
> GC> /// file:///C:/lmi/src/web/lmi/sequence_input.html
^^^^^^^^^^^
Oops. Should be:
http://www.nongnu.org/lmi/sequence_input.html
Would you mind correcting that in your patch?
And whenever we find one mistake...
/lmi/src/lmi[0]$grep 'file:///' *.?pp
wx_test_input_sequences.cpp:/// file:///C:/lmi/src/web/lmi/sequence_input.html
wx_test_paste_census.cpp:///
file:///C:/lmi/src/web/lmi/pasting_to_a_census.html
Would you mind correcting that one, too, when you address that file?
[I'll post it to that file's separate thread to make it easy to remember.]
> GC> /// but hard code them here--later they might differ, e.g. if we
> GC> /// decide to add extra tests here.
> GC> ///
> GC> /// First, create a temporary '.ill' document:
> GC> /// File | New | Illustration
> GC> /// Then paste each input sequence into the appropriate field
>
> After some trial and error, it seems that the "appropriate field" for all
> the sequences currently in InputSequences.cns is "Face|Specified amount"
["Specified amount" is not necessarily on a "Face" tab; it might be
on another tab, and might have a different <title> and be next to
a different static-text <label>:
<object class="wxStaticText">
<label>Specified amount</label> <!-- MAY DIFFER -->
<object class="InputSequenceEntry" name="SpecifiedAmount">
<title>Specified amount</title> <!-- MAY DIFFER -->
so please let's search dynamically for the "name=" identifier.]
> one, but please correct me if I'm wrong.
I'll spell everything out below.
BTW, we may test a variety of UI "skins" that use different sets of
input fields, and place them on various tabs. The "master" skin is
'skin.xrc': it is intended to contain every input field (and probably
does, thought I haven't verified that recently). Other skins may lack
some fields. And some fields are conditionally grayed; and the graying
may depend on the "ProductName" specified in "File | Default". In the
list below, I've chosen fields that I think are non-grayed by default
in 'skin.xrc', but even with a lot more effort I'm not sure it would
be possible to choose fields that are always present and never grayed
by default in every skin...
...so whenever an individual sequence-paste test cannot be run because
of these reasons, I believe we should skip it silently. (It's not
actually interesting to report that it was skipped.) I myself will
always run the input-sequence GUI test before any release (in fact,
much more frequently than that), and I will always use "skin.xrc",
so it is certain that every sequence will be tested often.
> I'm less sure what to use for
> "annual; monthly" one: should it be entered into "Payments|Individual mode"
> or somewhere else?
Yes.
> GC> and test
> GC> /// it thus:
> GC> /// - Click the ellipsis button; press OK to close its dialog.
> GC> /// - Click OK to run the illustration. This step is tested because
> GC> /// it triggers downstream validation.
> GC> /// Reopen the tabbed dialog for each subsequent test.
>
> I assume the last one should done with "Illustration|Edit Cell" (Ctrl-E),
> is this right?
Yes.
Here's a complete list of input sequences from the user manual, with
a numbers-only sequence added, showing the field (in .xrc files, the
"name=" identifier) to use for each.
First, here's a complete list of the user-manual sequences (which I
copied and pasted from the webpage, so if it doesn't match what you
already have in the code, that's probably a mistake somewhere):
"SpecifiedAmount" sevenpay 7; 250000 retirement; 100000 #10; 75000 @95; 50000
"SpecifiedAmount" 100000; 110000; 120000; 130000; 140000; 150000
"PaymentMode" annual; monthly
"Payment" 10000 20; 0
"Payment" 10000 10; 5000 15; 0
"Payment" 10000 @70; 0
"Payment" 10000 retirement; 0
"Payment" 0 retirement; 5000
"Payment" 0 retirement; 5000 maturity
"Withdrawal" 0 retirement; 5000 #10; 0
"Withdrawal" 0,[0,retirement);10000,[retirement,#10);0
If it's trivial to do, then it might be nice to write a comment
preceding those to the effect that they're from the user manual,
and then document that this one is additional:
"ProjectedSalary" 100000; 105000; 110000 retirement; 0