Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Alchemy Viewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Silent mode is enabled
All outbound communications are blocked.
Learn more
.
Show more breadcrumbs
Alchemy Viewer
Alchemy Viewer
Commits
9c7c331b
Commit
9c7c331b
authored
3 years ago
by
Rye Mutt
Browse files
Options
Downloads
Patches
Plain Diff
Fix LLSD serialization tests with python3
parent
58f3139a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!35
Convert viewer tree to utilize python3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
indra/llcommon/tests/llsdserialize_test.cpp
+7
-7
7 additions, 7 deletions
indra/llcommon/tests/llsdserialize_test.cpp
with
7 additions
and
7 deletions
indra/llcommon/tests/llsdserialize_test.cpp
+
7
−
7
View file @
9c7c331b
...
...
@@ -1795,7 +1795,7 @@ namespace tut
set_test_name
(
"verify NamedTempFile"
);
python
(
"platform"
,
"import sys
\n
"
"print
'Running on
',
sys.platform
\n
"
);
"print
(
'Running on
%s' %
sys.platform
)
\n
"
);
}
// helper for test<3>
...
...
@@ -1825,14 +1825,14 @@ namespace tut
const
char
pydata
[]
=
"def verify(iterable):
\n
"
" it = iter(iterable)
\n
"
" assert
it.
next() == 17
\n
"
" assert abs(
it.
next() - 3.14) < 0.01
\n
"
" assert
it.
next() == '''
\\\n
"
" assert next(
it
) == 17
\n
"
" assert abs(next(
it
) - 3.14) < 0.01
\n
"
" assert next(
it
) == '''
\\\n
"
"This string
\n
"
"has several
\n
"
"lines.'''
\n
"
" try:
\n
"
"
it.
next()
\n
"
" next(
it
)
\n
"
" except StopIteration:
\n
"
" pass
\n
"
" else:
\n
"
...
...
@@ -1852,7 +1852,7 @@ namespace tut
import_llsd
<<
"def parse_each(iterable):
\n
"
" for item in iterable:
\n
"
" yield llsd.parse(item)
\n
"
<<
" yield llsd.parse(item
.encode(
\"
utf-8
\"
)
)
\n
"
<<
pydata
<<
// Don't forget raw-string syntax for Windows pathnames.
"verify(parse_each(open(r'"
<<
file
.
getName
()
<<
"')))
\n
"
);
...
...
@@ -1884,7 +1884,7 @@ namespace tut
// N.B. Using 'print' implicitly adds newlines.
"with open(r'"
<<
file
.
getName
()
<<
"', 'w') as f:
\n
"
" for item in DATA:
\n
"
" print
>>f,
llsd.format_notation(item)
\n
"
);
" print
(
llsd.format_notation(item)
.decode(
\"
utf-8
\"
), file=f)
\n
"
);
std
::
ifstream
inf
(
file
.
getName
().
c_str
());
LLSD
item
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment