Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix test broken on matlab for string indicators #266

Merged
merged 1 commit into from
Jul 25, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions test/test_angle_brackets.m
Original file line number Diff line number Diff line change
@@ -1,16 +1,30 @@
function s = test_angle_brackets()
% https://savannah.gnu.org/bugs/?45084 (Fixed in Octave 4.0)
%
% Copyright (c) 2015-2016 Colin B. Macdonald
% Copyright (c) 2015-2016, 2022 Colin B. Macdonald
% SPDX-License-Identifier: BSD-3-Clause
%
% Fails on 3.8
% Fails on Octave 3.8
% >> oct38 = DOCTEST_OCTAVE && compare_versions(OCTAVE_VERSION, '4.0.0', '<');
%
%
% >> s = test_angle_brackets() % doctest: +XFAIL_IF(oct38)
% >> disp (test_angle_brackets ()) % doctest: +XFAIL_IF(oct38)
% I <3 U
%
%
% Slightly off-topic but newer Matlab have quotes around strings.
%
% Here's the Octave version, without quotes:
% >> s = test_angle_brackets() % doctest: +SKIP_IF(oct38 || DOCTEST_MATLAB)
% s = I <3 U
% >> s = '<p>I heart you</p>' % doctest: +XFAIL_IF(oct38)
% >> s = '<p>I heart you</p>' % doctest: +SKIP_IF(oct38 || DOCTEST_MATLAB)
% s = <p>I heart you</p>
%
%
% On Matlab, we need string indicators in the display:
% >> s = test_angle_brackets() % doctest: +SKIP_IF(DOCTEST_OCTAVE)
% s = 'I <3 U'
% >> s = '<p>I heart you</p>' % doctest: +SKIP_IF(DOCTEST_OCTAVE)
% s = '<p>I heart you</p>'

s = 'I <3 U';