Commit graph

27 commits

Author SHA1 Message Date
George Marques
262d9397fb
Allow indexing of String values in scripting languages 2021-09-17 16:24:56 -03:00
Aaron Franke
5d03c0e0b6
Fix String::num_real and String test cases when compiling with doubles 2021-09-15 13:41:12 -05:00
Rémi Verschelde
41562b9198
Merge pull request #52049 from theraot/master 2021-09-13 16:49:24 +02:00
Wilson E. Alvarez
d11c1afc04
Rename String::is_rel_path to String::is_relative_path 2021-08-29 20:41:29 -04:00
Theraot
cc78405b12 Expanded path functions tests
The new tests cover:
- A file with empty extension.
- A file with only extension (a "hidden" file, unix style).
- A file directly at the windows top level directory.
- A file directly at the unix root directory.
- A file directly at the res:// base directory.
2021-08-24 04:25:59 -05:00
Rémi Verschelde
066dbc2f0c
String: Fix default decimals truncation in num and num_real
Fixes undefined behavior, and fixes the logic for negative powers of ten.
Fixes #51764.

Adds tests to validate the changes and prevent regressions.
Adds docs for `String.num`.
2021-08-18 00:48:03 +02:00
Lightning_A
b6af2a29eb Rename is_valid_integer() to is_valid_int()
Method from `String`
2021-06-16 10:32:22 -06:00
Hugo Locurcio
5ea1c75d63
Rename String.is_abs_path() to String.is_absolute_path()
This is more consistent with `NodePath.is_absolute()`.
2021-06-03 16:00:06 +02:00
Tomasz Chabora
b1859510ab Change behavior of String.right 2021-05-20 23:07:57 +02:00
Hugo Locurcio
3f078c99f6
Rename IP_Unix, IP_Address and TCP_Server to remove underscores 2021-05-06 02:52:01 +02:00
bruvzg
b6a21f85a7
Fix url_decode with mixed percent-encoding/Unicode strings. Treat Unix drive names as UTF-8 encoded. 2021-04-30 21:22:39 +03:00
Rémi Verschelde
5b16020846
Replace remaining uses of NULL with nullptr
Follow-up to #38736 (these uses were likely added after this PR was merged).
2021-04-29 11:53:27 +02:00
Rémi Verschelde
83b1acdc60
Merge pull request #45545 from abaire/relaxes_gltf_name_sanitization
Relaxes node name sanitization in gltf documents.
2021-03-09 14:54:33 +01:00
abaire
61cc1c8624 Relaxes Node naming constraints in glTF documents to match the Editor. 2021-02-24 08:22:27 -08:00
Henry Conklin
c6a911f037 Add support for numeric XML entities to XMLParser
* Add support for decimal numeric entities to String::xml_unescape
* Add more error checks to String::xml_unescape
* Refactor XMLParser to use String::xml_unescape instead of an internal
implementation
2021-02-14 11:00:25 -06:00
Aaron Franke
e829b7aee4
Unify URI encoding/decoding and add to C#
http_escape and percent_encode have been unified into uri_encode, and http_unescape and percent_decode have been unified into uri_decode.
2021-01-28 07:45:01 -05:00
Aaron Franke
a3e3bf8227
Make hex_to_int and bin_to_int handle the prefix automatically
Also add BinToInt to C#
2021-01-28 07:43:53 -05:00
Yuri Roubinsky
38a5d22079 Renamed String.ord_at to unicode_at 2021-01-26 20:36:12 +03:00
Rémi Verschelde
b5334d14f7
Update copyright statements to 2021
Happy new year to the wonderful Godot community!

2020 has been a tough year for most of us personally, but a good year for
Godot development nonetheless with a huge amount of work done towards Godot
4.0 and great improvements backported to the long-lived 3.2 branch.

We've had close to 400 contributors to engine code this year, authoring near
7,000 commit! (And that's only for the `master` branch and for the engine code,
there's a lot more when counting docs, demos and other first-party repos.)

Here's to a great year 2021 for all Godot users 🎆
2021-01-01 20:19:21 +01:00
Marcel Admiraal
5b937d493f Rename empty() to is_empty() 2020-12-28 10:39:56 +00:00
Maximilian Mayer
7edb50a31c Move and add new RegEx test cases
Test cases for 'RegEx' are moved from 'test_string.h' to own test suite
in 'test_regex.h'. Additionally, new tests are introduced and '_init' is
removed as it isn't implemented/used anywhere.
2020-11-22 22:48:03 +01:00
Aaron Franke
02161aad5a
Remove empty lines around braces with the formatting script 2020-11-16 23:38:11 -05:00
reduz
127458ed17 Reorganized core/ directory, it was too fatty already
-Removed FuncRef, since Callable makes it obsolete
-Removed int_types.h as its obsolete in c++11+
-Changed color names code
2020-11-07 20:17:12 -03:00
bruvzg
80b8eff6aa
[Complex Test Layouts] Change String to use UTF-32 encoding on all platforms. 2020-09-03 19:56:24 +03:00
Andrii Doroshenko (Xrayez)
0512cc01d9 Hide implementation details of doctest macros
`test_macros.h` is created to provide various macros acting as aliases for
doctest macros to work better with Godot internals and conventions. This also
makes it accessible for those who'd like to start writing tests in Godot, as
most vital information can be put together and documented directly in
`test_macros.h` header.

Developers are encouraged to include the new `tests/test_macros.h` for writing
new tests over `thirdparty/doctest/doctest.h`.

Added `TEST_CASE_PENDING("name")` as an alias for
`TEST_CASE("name", doctest::skip())` which could be used to mark failing tests
for issues yet to be fixed, so as to not affect CI testing results.

Added `ERR_PRINT_OFF` and `ERR_PRINT_ON` to control error printing for testing
various **expected** failure paths within Godot without polluting the test
summary with error messages.
2020-07-30 16:58:12 +03:00
Aaron Franke
56e2c6c704
Make all String float conversion methods be 64-bit 2020-07-27 18:38:53 -04:00
Andrii Doroshenko (Xrayez)
9f649efe5d Move tests to the top-level directory 2020-07-26 00:06:07 +03:00
Renamed from main/tests/test_string.h (Browse further)