Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
fmt
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
fmt
Commits
8a2c3fb8
Commit
8a2c3fb8
authored
Dec 13, 2021
by
Alexey Ochapov
Committed by
Victor Zverovich
Dec 27, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add reverse tests to compile-error-test
to make sure that error tests do not fail because they become outdated
parent
1164eda5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
4 deletions
+17
-4
test/compile-error-test/CMakeLists.txt
test/compile-error-test/CMakeLists.txt
+17
-4
No files found.
test/compile-error-test/CMakeLists.txt
View file @
8a2c3fb8
...
...
@@ -116,19 +116,28 @@ endfunction ()
# check if the source file skeleton compiles
expect_compile
(
check
""
)
expect_compile
(
check-error
"compilation_error"
ERROR
)
# Formatting a wide character with a narrow format string is forbidden.
expect_compile
(
wide-character-narrow-format-string
"fmt::format(
\"
{}
\"
, L'a');"
ERROR
)
expect_compile
(
wide-character-narrow-format-string
"fmt::format(L
\"
{}
\"
, L'a');"
)
expect_compile
(
wide-character-narrow-format-string-error
"fmt::format(
\"
{}
\"
, L'a');"
ERROR
)
# Formatting a wide string with a narrow format string is forbidden.
expect_compile
(
wide-string-narrow-format-string
"fmt::format(
\"
{}
\"
, L
\"
foo
\"
);"
ERROR
)
expect_compile
(
wide-string-narrow-format-string
"fmt::format(L
\"
{}
\"
, L
\"
foo
\"
);"
)
expect_compile
(
wide-string-narrow-format-string-error
"fmt::format(
\"
{}
\"
, L
\"
foo
\"
);"
ERROR
)
# Formatting a narrow string with a wide format string is forbidden because
# mixing UTF-8 with UTF-16/32 can result in an invalid output.
expect_compile
(
narrow-string-wide-format-string
"fmt::format(L
\"
{}
\"
,
\"
foo
\"
);"
ERROR
)
expect_compile
(
narrow-string-wide-format-string
"fmt::format(L
\"
{}
\"
, L
\"
foo
\"
);"
)
expect_compile
(
narrow-string-wide-format-string-error
"fmt::format(L
\"
{}
\"
,
\"
foo
\"
);"
ERROR
)
# Formatting a wide string with a narrow format string is forbidden.
expect_compile
(
cast-to-string
"
struct S {
operator std::string() const { return std::string(); }
};
fmt::format(
\"
{}
\"
, std::string(S()));
"
)
expect_compile
(
cast-to-string-error
"
struct S {
operator std::string() const { return std::string(); }
};
...
...
@@ -137,6 +146,10 @@ expect_compile(cast-to-string "
# Formatting a function
expect_compile
(
format-function
"
void (*f)();
fmt::format(
\"
{}
\"
, fmt::ptr(f));
"
)
expect_compile
(
format-function-error
"
void (*f)();
fmt::format(
\"
{}
\"
, f);
"
ERROR
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment