summaryrefslogtreecommitdiff
path: root/Tests
AgeCommit message (Collapse)Author
2022-03-02AK: Print NaN and infinite numbers in PrintfImplementationPeter Ross
2022-03-02LibC: Set PRI[xX]8/PRI[xX]16 macros to `x` and `X`Peter Ross
Described in: <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/ inttypes.h.html> The macros were first added in a7a456002e91d9f13793e23aab4c24519c4e87c7, but it is not clear why the PRIx16/32 macros were defined as 'b' & 'w'. PrintfImplementation was never able to parse these values.
2022-02-28AK: Add tests for integer values formatting in printfTimur Sultanov
2022-02-28AK: Add FixedPoint base 2 logarithmkleines Filmröllchen
The log base 2 is implemented using the binary logarithm algorithm by Clay Turner (see the link in the comment)
2022-02-28AK: Fix FixedPoint to integral comparisonskleines Filmröllchen
Add tests to ensure that the fixed point numbers compare correctly to integrals
2022-02-27Tests: Test DisjointChunks with FixedArraykleines Filmröllchen
2022-02-25AK: Ignore whitespace while decoding base64Andreas Kling
This matches how other implementations behave. 1% progression on ACID3. :^)
2022-02-23LibTest+Spreadsheet: Add some basic spreadsheet runtime behaviour testsAli Mohammad Pur
As there's a somewhat active development going on, let's keep the expected behaviour under tests to make sure nothing blows up :^)
2022-02-21LibWeb: Make document.write() work while document is parsingAndreas Kling
This necessitated making HTMLParser ref-counted, and having it register itself with Document when created. That makes it possible for scripts to add new input at the current parser insertion point. There is now a reference cycle between Document and HTMLParser. This cycle is explicitly broken by calling Document::detach_parser() at the end of HTMLParser::run(). This is a huge progression on ACID3, from 31% to 49%! :^)
2022-02-21LibWeb: Fix 'Comment end state' in HTML TokenizerAdam Hodgen
Also, update the expected hash in the LibWeb TestHTMLTokenizer regression test. This is due to the "This comment has a few too many dashes." comment token being updated.
2022-02-20LibRegex: Make codegen+optimisation for alternatives much fasterAli Mohammad Pur
Just a little thinking outside the box, and we can now parse and optimise a million copies of "a|" chained together in just a second :^)
2022-02-20LibRegex: Make parse_disjunction() consume all disjunctions in one frameAli Mohammad Pur
This helps us not blow up when too many disjunctions are chained togther in the regex we're parsing. Fixes #12615.
2022-02-20LibRegex: Allow quantifiers after quantifiable assertionsAli Mohammad Pur
While quantifying assertions is very much meaningless, the specification allows them with annex B's extended grammar for browsers, so read and apply the quantifiers. Fixes #12373.
2022-02-20LibC: Do not write value when scanf assignment value is suppressedPeter Ross
This change has the positive side-effect of causing scanf to *segfault* when a NULL pointer argument is passed to scanf. e.g. sscanf(str, "%d", NULL);
2022-02-20LibC: Do not include suppressed assignments in scanf return valuePeter Ross
2022-02-18LibCrypto: Add curve x25519stelar7
2022-02-16LibCore+Everywhere: Return ErrorOr from ConfigFile factory methodsSam Atkins
I've attempted to handle the errors gracefully where it was clear how to do so, and simple, but a lot of this was just adding `release_value_but_fixme_should_propagate_errors()` in places.
2022-02-16LibCore+Tests: Add SeekableStream::truncate()Sam Atkins
2022-02-16AK: Fix userland parsing of rounded floating point numbersserenitydev
Parse JSON floating point literals properly, No longer throwing a SyntaxError when the decimal portion of the number exceeds the capacity of u32. Added tests to AK/TestJSON and LibJS/builtins/JSON/JSON.parse
2022-02-15AK+Kernel: OOM-harden most parts of TrieAli Mohammad Pur
The only part of Unveil that can't handle OOM gracefully is the String::formatted() use in the node metadata.
2022-02-15Tests: Add Unicode tests for CharacterType block propertiesthankyouverycool
2022-02-14LibCore+Tests: Remove Core::UDPSocket :^)sin-ack
2022-02-14LibRegex: Correct the alternative matching order when one is emptyAli Mohammad Pur
Previously we were compiling `/a|/` into what effectively would be `/|a`, which is clearly incorrect.
2022-02-14LibWeb: Fix highlighting HTML commentsKarol Kosek
Commit b193351a99 caused the HTML comments to flash when changing the text cursor. Also, when double-clicking on a comment, the selection started from the beginning of the file instead. The following message was displaying when `TOKENIZER_TRACE_DEBUG` was enabled: (Tokenizer::nth_last_position) Invalid position requested: 4th-last of 4. Returning (0-0). Changing the `nth_last_position` to 3 fixes this. I'm guessing that's because the parser is at that moment on the second hyphen of the `<!--` string, so it has to go back only by three characters.
2022-02-13LibSQL: Convert binary SQL operations to be fallibleTimothy Flynn
Now that expression evaluation can use TRY, we can allow binary operator methods to fail as well. This also fixes a few instances of converting a Value to a double when we meant to convert to an integer.
2022-02-13LibSQL: Implement converting float and tuple values to a booleanTimothy Flynn
2022-02-13Tests: Add test for LibC mkdir()Max Wipfli
2022-02-13LibWeb: Update TestHTMLTokenizer's expected token hashTimothy Flynn
The output of the tokenizer changed in commit: b193351a998dab06228bf6cb8c2b0828704839c1.
2022-02-13Tests: Wrap test-bytecode-js source in an IIFEAli Mohammad Pur
Putting everything in the global scope will lead to mayhem and failing tests with an actually correct implementation of scoping :^) Also adds in a tiny debug log of the exception, otherwise we'd be staring at failing tests with no info on what failed.
2022-02-13LibJS: Make ASTNode::generate_bytecode() fallibleAli Mohammad Pur
Instead of crashing on the spot, return a descriptive error that will eventually continue its days as a javascript "InternalError" exception. This should make random crashes with BC less likely.
2022-02-11AK: Make Bitmap construction OOM-fallibleIdan Horowitz
2022-02-10LibSQL+SQLServer: Introduce and use ResultOr<ValueType>Timothy Flynn
The result of a SQL statement execution is either: 1. An error. 2. The list of rows inserted, deleted, selected, etc. (2) is currently represented by a combination of the Result class and the ResultSet list it holds. This worked okay, but issues start to arise when trying to use Result in non-statement contexts (for example, when introducing Result to SQL expression execution). What we really need is for Result to be a thin wrapper that represents both (1) and (2), and to not have any explicit members like a ResultSet. So this commit removes ResultSet from Result, and introduces ResultOr, which is just an alias for AK::ErrorOrr. Statement execution now returns ResultOr<ResultSet> instead of Result. This further opens the door for expression execution to return ResultOr<Value> in the future. Lastly, this moves some other context held by Result over to ResultSet. This includes the row count (which is really just the size of ResultSet) and the command for which the result is for.
2022-02-10AK: Clear minimum when removing last node of RedBlackTreedavidot
2022-02-10AK: Fix RedBlackTree::find_smallest_not_below_iteratordavidot
Before this was incorrectly assuming that if the current node `n` was at least the key and the left child of `n` was below the key that `n` was always correct. However, the right child(ren) of the left child of `n` could still be at least the key. Also added some tests which produced the wrong results before this.
2022-02-10LibSQL: Do not crash when SELECTing from an empty tableTimothy Flynn
The crash was caused by getting the first element of an empty vector.
2022-02-10LibSQL+SQLServer: Move LibSQL/SQLResult.[h,cpp] to LibSQL/Result.[h,cpp]Timothy Flynn
Rename the file to match the new class name.
2022-02-10LibSQL+SQLServer: Return the new Result class from statement executionsTimothy Flynn
We can now TRY anything that returns a SQL::Result or an AK::Error.
2022-02-09LibRegex: Only skip full instructions when optimizing alternationsAli Mohammad Pur
It makes no sense to skip half of an instruction, so make sure to skip only full instructions!
2022-02-08LibWeb: Introduce the Environment Settings ObjectLuke Wilde
The environment settings object is effectively the context a piece of script is running under, for example, it contains the origin, responsible document, realm, global object and event loop for the current context. This effectively replaces ScriptExecutionContext, but it cannot be removed in this commit as EventTarget still depends on it. https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object
2022-02-08LibJS+Everywhere: Remove VM::exception() and most related functionsdavidot
This commit removes all exception related code: Remove VM::exception(), VM::throw_exception() etc. Any leftover throw_exception calls are moved to throw_completion. The one method left is clear_exception() which is now a no-op. Most of these calls are just to clear whatever exception might have been thrown when handling a Completion. So to have a cleaner commit this will be removed in a next commit. It also removes the actual Exception and TemporaryClearException classes since these are no longer used. In any spot where the exception was actually used an attempt was made to preserve that behavior. However since it is no longer tracked by the VM we cannot access exceptions which were thrown in previous calls. There are two such cases which might have different behavior: - In Web::DOM::Document::interpreter() the on_call_stack_emptied hook used to print any uncaught exception but this is now no longer possible as the VM does not store uncaught exceptions. - In js the code used to be interruptable by throwing an exception on the VM. This is no longer possible but was already somewhat fragile before as you could happen to throw an exception just before a VERIFY.
2022-02-08LibJS: Convert Instruction::execute in bytecode to ThrowCompletionOrdavidot
This allows us to use TRY in these functions :^).
2022-02-08LibJS: Convert ArrayBuffer construction to ThrowCompletionOrdavidot
This also allows us to create TypedArrays with an existing buffer thus clearing up an additional FIXME in TextEncoder.
2022-02-06AK: Introduce IntegralMath.h starting with pow<I>Hendiadyoin1
2022-02-06LibCore+Userland: Remove Core::TCPSocket :^)sin-ack
This was deprecated in favor of Core::Stream::TCPSocket, and now has no users.
2022-02-06LibCrypto: Do not allow signed big integers to be negative zeroTimothy Flynn
If a big integer were to become negative zero, set the sign to instead be positive. This prevents odd scenarios where users of signed big ints would falsely think the result of some big int arithmetic is negative.
2022-02-06Userland: Convert TLS::TLSv12 to a Core::Stream::SocketAli Mohammad Pur
This commit converts TLS::TLSv12 to a Core::Stream object, and in the process allows TLS to now wrap other Core::Stream::Socket objects. As a large part of LibHTTP and LibGemini depend on LibTLS's interface, this also converts those to support Core::Stream, which leads to a simplification of LibHTTP (as there's no need to care about the underlying socket type anymore). Note that RequestServer now controls the TLS socket options, which is a better place anyway, as RS is the first receiver of the user-requested options (though this is currently not particularly useful).
2022-02-06LibCore: Remove Core::LocalSocket :^)sin-ack
2022-02-05LibRegex: Support non-ASCII whitespace characters when matching \s or \STimothy Flynn
ECMA-262 defines \s as: Return the CharSet containing all characters corresponding to a code point on the right-hand side of the WhiteSpace or LineTerminator productions. The LineTerminator production is simply: U+000A, U+000D, U+2028, or U+2029. Unfortunately there isn't a Unicode property that covers just those code points. The WhiteSpace production is: U+0009, U+000B, U+000C, U+FEFF, or any code point with the Space_Separator general category. If the Unicode generators are disabled, this will fall back to ASCII space code points.
2022-02-05LibSQL: Implement DESCRIBE TABLE testsMahmoud Mandour
2022-02-05LibJS+LibRegex: Don't repeat regex match in regexp_exec()Ali Mohammad Pur
LibRegex already implements this loop in a more performant way, so all LibJS has to do here is to return things in the right shape, and not loop over the input string. Previously this was a quadratic operation on string length, which lead to crazy execution times on failing regexps - now it's nice and fast :^) Note that a Regex test has to be updated to remove the stateful flag as it repeats matching on multiple strings.