Mercurial > octave
annotate test/ctor-vs-method/ctor-vs-method.tst @ 31706:597f3ee61a48 stable
update Octave Project Developers copyright for the new year
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 06 Jan 2023 13:11:27 -0500 |
parents | 796f54d4ddbf |
children | 2e484f9f1f18 |
rev | line source |
---|---|
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
1 ######################################################################## |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
2 ## |
31706
597f3ee61a48
update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents:
30564
diff
changeset
|
3 ## Copyright (C) 2012-2023 The Octave Project Developers |
27918
b442ec6dda5c
use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
4 ## |
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
5 ## See the file COPYRIGHT.md in the top-level directory of this |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
6 ## distribution or <https://octave.org/copyright/>. |
13147
6c952376482d
look for methods before constructors
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
7 ## |
6c952376482d
look for methods before constructors
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
8 ## This file is part of Octave. |
6c952376482d
look for methods before constructors
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
9 ## |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
10 ## Octave is free software: you can redistribute it and/or modify it |
13147
6c952376482d
look for methods before constructors
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
11 ## under the terms of the GNU General Public License as published by |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
12 ## the Free Software Foundation, either version 3 of the License, or |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
13 ## (at your option) any later version. |
13147
6c952376482d
look for methods before constructors
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
14 ## |
6c952376482d
look for methods before constructors
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
15 ## Octave is distributed in the hope that it will be useful, but |
6c952376482d
look for methods before constructors
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
16 ## WITHOUT ANY WARRANTY; without even the implied warranty of |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
17 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
18 ## GNU General Public License for more details. |
13147
6c952376482d
look for methods before constructors
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
19 ## |
6c952376482d
look for methods before constructors
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
20 ## You should have received a copy of the GNU General Public License |
6c952376482d
look for methods before constructors
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
21 ## along with Octave; see the file COPYING. If not, see |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
22 ## <https://www.gnu.org/licenses/>. |
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
23 ## |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
24 ######################################################################## |
13147
6c952376482d
look for methods before constructors
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
25 |
6c952376482d
look for methods before constructors
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
26 %% Test script for legacy OOP. |
6c952376482d
look for methods before constructors
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
27 %% Requires the path to contain the directory ctor-vs-method. |
6c952376482d
look for methods before constructors
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
28 %% |
6c952376482d
look for methods before constructors
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
29 %% Note: This script and all classes are also intended to run |
6c952376482d
look for methods before constructors
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
30 %% in Matlab to test compatibility. Don't break that! |
6c952376482d
look for methods before constructors
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
31 |
6c952376482d
look for methods before constructors
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
32 %!shared d, o |
6c952376482d
look for methods before constructors
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
33 %! d = derived (); |
6c952376482d
look for methods before constructors
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
34 %! o = other (); |
6c952376482d
look for methods before constructors
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
35 %! |
21581
6fab85c1538f
maint: Follow Octave conventions for use of semicolon in BIST tests.
Rik <rik@octave.org>
parents:
21580
diff
changeset
|
36 %!error method (o) |
13147
6c952376482d
look for methods before constructors
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
37 |
6c952376482d
look for methods before constructors
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
38 %!test |
6c952376482d
look for methods before constructors
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
39 %! ctrace = {'begin parent/method'; |
6c952376482d
look for methods before constructors
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
40 %! 'begin derived/parent'; |
6c952376482d
look for methods before constructors
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
41 %! 'begin parent/parent'; |
6c952376482d
look for methods before constructors
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
42 %! 'end parent/parent'; |
6c952376482d
look for methods before constructors
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
43 %! 'end derived/parent'; |
6c952376482d
look for methods before constructors
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
44 %! 'end parent/method'}; |
21580
ecce63c99c3f
maint: Add semicolons to terminate code in %! blocks.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
45 %! __trace__ (); # clear call trace info |
13147
6c952376482d
look for methods before constructors
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
46 %! method (d); |
6c952376482d
look for methods before constructors
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
47 %! assert (__trace__ (), ctrace); |
6c952376482d
look for methods before constructors
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
48 |
6c952376482d
look for methods before constructors
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
49 %!test |
6c952376482d
look for methods before constructors
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
50 %! ctrace = {'begin other/parent'; |
6c952376482d
look for methods before constructors
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
51 %! 'end other/parent'}; |
21580
ecce63c99c3f
maint: Add semicolons to terminate code in %! blocks.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
52 %! __trace__ (); # clear call trace info |
13147
6c952376482d
look for methods before constructors
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
53 %! parent (o); |
6c952376482d
look for methods before constructors
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
54 %! assert (__trace__ (), ctrace); |
6c952376482d
look for methods before constructors
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
55 |
6c952376482d
look for methods before constructors
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
56 %!test |
6c952376482d
look for methods before constructors
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
57 %! ctrace = {'begin derived/parent'; |
6c952376482d
look for methods before constructors
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
58 %! 'begin parent/parent'; |
6c952376482d
look for methods before constructors
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
59 %! 'end parent/parent'; |
6c952376482d
look for methods before constructors
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
60 %! 'end derived/parent'}; |
21580
ecce63c99c3f
maint: Add semicolons to terminate code in %! blocks.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
61 %! __trace__ (); # clear call trace info |
13147
6c952376482d
look for methods before constructors
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
62 %! parent (d); |
6c952376482d
look for methods before constructors
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
63 %! assert (__trace__ (), ctrace); |