summaryrefslogtreecommitdiff
path: root/Tests
AgeCommit message (Collapse)Author
2021-07-04LibWeb/WebAssembly+test-wasm: Use get_without_side_effects() moreLinus Groh
2021-07-04Tests: Add test for String::roman_number_from()Tobias Christiansen
2021-07-04Everywhere: Prefer using "..."sv over StringView { "..." }Gunnar Beutner
2021-07-04Tests: Add tests for `Optional`'s conditionally trivial functionsDaniel Bertalan
2021-07-04AK: Destroy original value when assigning to VariantDaniel Bertalan
2021-07-04Tests: Add test for supported operation type traitsDaniel Bertalan
2021-07-02Tests: Add test for String::find with empty needleMax Wipfli
This adds a test case for String::find and String::find_all with empty needles. The expected behavior is in line with what the C++ standard library (and other languages standard libraries) expect.
2021-07-02AK: Implement String::find_any_of() and StringView::find_any_of()Max Wipfli
This implements StringUtils::find_any_of() and uses it in String::find_any_of() and StringView::find_any_of(). All uses of find_{first,last}_of have been replaced with find_any_of(), find() or find_last(). find_{first,last}_of have subsequently been removed.
2021-07-02AK+Everywhere: Remove StringView::find_{first,last}_of(char) methodsMax Wipfli
This removes StringView::find_first_of(char) and find_last_of(char) and replaces all its usages with find and find_last respectively. This is because those two methods are functionally equivalent. find_{first,last}_of should only be used if searching for multiple different characters, which is never the case with the char argument. This also adds the [[nodiscard]] to the remaining find_{first,last}_of methods.
2021-07-02Tests+LibThreading: Add new tests for LibThreading for detach()Spencer Dixon
2021-07-02LibWasm: Give traps a reason and display it when neededAli Mohammad Pur
This makes debugging wasm code a bit easier, as we now know what fails instead of just "too bad, something went wrong".
2021-07-01LibCrypto: Add tests for SignedBigInteger bitwise operationsGal Horowitz
2021-06-30AK+Everywhere: Remove "null state" of LexicalPathMax Wipfli
This removes the default constructor of LexicalPath, and subsequently modifies all its users to accommodate the change.
2021-06-30AK: Make LexicalPath immutableMax Wipfli
This replaces the current LexicalPath::append() API with a new method that returns a new LexicalPath object and doesn't touch the this-object. With this, LexicalPath is now immutable. It also adds a LexicalPath::parent() method and the relevant test cases.
2021-06-30Tests: Rewrite tests for LexicalPathMax Wipfli
2021-06-30AK: Remove the LexicalPath::is_valid() APIMax Wipfli
Since this is always set to true on the non-default constructor and subsequently never modified, it is somewhat pointless. Furthermore, there are arguably no invalid relative paths.
2021-06-30Userland+Tests: Split out generic test runner from JS TestRunnerAndrew Kaster
Split out the functionality to gather multiple tests from the filesystem and run them in turn into Test::TestRunner, and leave the JavaScript specific test harness logic in Test::JS::TestRunner and friends.
2021-06-30Tests: TestProcFs cannot assume stdin/stdout/stderr are the sameAndrew Kaster
If someone runs the test with shell redirection going on, or in a way that changes any of the standard file descriptors this assumption will not hold. When running from a terminal normally, it is true however. Instead, check that /proc/self/fd/[0,1,2] are symlinks, and can be stat-d by verifying that both stat and lstat succeed, and give different struct stat contents.
2021-06-29LibCrypto: Replace from_base{2,8,10,16}() & to_base10 with from_base(N)Idan Horowitz
This allows us to support parsing and serializing BigIntegers to and from any base N (such that 2 <= N <= 36).
2021-06-28AK: Add and use the RemoveCVReference<T> type traitAli Mohammad Pur
2021-06-27LibJS: Rename Function => FunctionObjectAndreas Kling
2021-06-27AK: Make the constexpr StringView methods actually constexprAli Mohammad Pur
Also add some tests to ensure that they _remain_ constexpr. In general, any runtime assertions, weirdo C casts, pointer aliasing, and such shenanigans should be gated behind the (helpfully newly added) AK::is_constant_evaluated() function when the intention is to write constexpr-capable code. a.k.a. deliver promises of constexpr-ness :P
2021-06-26AK: Undo bogus Variant::downcast() renameAndreas Kling
I accidentally renamed these to verify_cast() when doing the global AK::downcast() rename.
2021-06-24AK: Rename downcast<T> => verify_cast<T>Andreas Kling
This makes it much clearer what this cast actually does: it will VERIFY that the thing we're casting is a T (using is<T>()).
2021-06-24Everywhere: Use nothrow new with `adopt_{ref,own}_if_nonnull`Daniel Bertalan
This commit converts naked `new`s to `AK::try_make` and `AK::try_create` wherever possible. If the called constructor is private, this can not be done, so we instead now use the standard-defined and compiler-agnostic `new (nothrow)`.
2021-06-24Tests: Disable kernel and LibC tests for x86_64Gunnar Beutner
Some of the tests assume 32-bit addresses, so let's disable them for now.
2021-06-24LibSQL: Reduce run time of TestSqlDatabaseJan de Visser
Scanning tables is a linear process using pointers in the table's tuples, and does not involve more 'stochastic' code paths like index traversals. Therefore the 1000 and 10000 row tests were basically overkill and added nothing we can't find out with less rows.
2021-06-24Tests: Reduce runtime of TestCharacterTypesMax Wipfli
This declares all test cases which compare function outputs over the entire Unicode range as `BENCHMARK_CASE`, to avoid them being run by CI. This reduces runtime of TestCharacterTypes (without benchmarks) by about one third.
2021-06-24LibSQL: Make lexer and parser more standard SQL compliantJan de Visser
SQL was standardized before there was consensus on sane language syntax constructs had evolved. The language is mostly case-insensitive, with unquoted text converted to upper case. Identifiers can include lower case characters and other 'special' characters by enclosing the identifier with double quotes. A double quote is escaped by doubling it. Likewise, a single quote in a literal string is escaped by doubling it. All this means that the strategy used in the lexer, where a token's value is a StringView 'window' on the source string, does not work, because the value needs to be massaged before being handed to the parser. Therefore a token now has a String containing its value. Given the limited lifetime of a token, this is acceptable overhead. Not doing this means that for example quote removal and double quote escaping would need to be done in the parser or in AST node construction, which would spread lexing basically all over the place. Which would be suboptimal. There was some impact on the sql utility and SyntaxHighlighter component which was addressed by storing the token's end position together with the start position in order to properly highlight it. Finally, reviewing the tests for parsing numeric literals revealed an inconsistency in which tokens we accept or reject: `1a` is accepted but `1e` is rejected. Related to this is the fate of `0x`. Added a FIXME reminding us to address this.
2021-06-24LibSQL: Move Lexer and Parser machinery to AST directoryJan de Visser
The SQL engine is expected to be a fairly sizeable piece of software. Therefore we're starting to restructure the codebase for growth.
2021-06-22LibSQL: Create databases in writable directorycoderdreams
2021-06-22LibCore: Add unit test for File::read_linecoderdreams
2021-06-22Meta+LibWasm: Add support for module linking testsAli Mohammad Pur
This commit makes the linking tests in the wasm spec test run.
2021-06-19LibSQL: Database layerJan de Visser
This patch implements the beginnings of a database API allowing for the creation of tables, inserting rows in those tables, and retrieving those rows.
2021-06-19LibSQL: Hash index implementation for the SQL storage layerJan de Visser
This patch implements a basic hash index. It uses the extendible hashing algorith. Also includes a test file.
2021-06-19LibSQL: BTree index, Heap, and Meta objects for SQL Storage layerJan de Visser
Unfortunately this patch is quite large. The main functionality included are a BTree index implementation and the Heap class which manages persistent storage. Also included are a Key subclass of the Tuple class, which is a specialization for index key tuples. This "dragged in" the Meta layer, which has classes defining SQL objects like tables and indexes.
2021-06-19LibSQL: Basic dynamic value classes for SQL Storage layerJan de Visser
This patch adds the basic dynamic value classes used by the SQL Storage layer. The most elementary class is Value, which holds a typed Value which can be converted to standard C++ types. A Tuple is a collection of Values described by a TupleDescriptor, which specifies the names, types, and ordering of the elements in the Tuple. Tuples and Values can be serialized and deserialized to and from ByteBuffers. This is mechanism which is used to save them to disk. Tuples are used as keys in SQL indexes and rows in SQL tables. Also included is a test file.
2021-06-19AK: Add support for keeping trailing zeros in fixed precision floatsIdan Horowitz
This uses the same syntax as zero padding integers: String::formatted("{:0.5}", 1.234) => "1.23400"
2021-06-19LibCrypto+LibTLS: Split and move test suite into Tests directoryPeter Bocan
This change splits test-crypto.cpp from Userland into separate test suites located in Tests/ directory.
2021-06-18Tests: Add a test for ProcFS fd interactionKyle Ambroff-Kao
Co-authored-by: Tim Schumacher <timschumi@gmx.de>
2021-06-17AK: Add some tests for hexdump formattingAli Mohammad Pur
2021-06-17Everywhere: Add component declarationsGunnar Beutner
This adds component declarations so that users can select to not build certain parts of the OS.
2021-06-16Tests: Add test for case-insensitive matchingsin-ack
2021-06-16AK+Tests: Add IntrusiveList<T,...>::insert_before(..) methodBrian Gianforcaro
The insert_before method on AK::InlineLinkedList is used, so in order to achieve feature parity, we need to implement it for AK::IntrusiveList as well.
2021-06-15AK: Add support for removing SinglyLinkedList nodes during iterationIdan Horowitz
This commit also fixes the now-broken usage of SinglyLinkedList::remove in the Piano application.
2021-06-13LibC: Make `getopt` modify `argv` againJelle Raaijmakers
A POSIX-compatibility fix was introduced in 64740a0214 to make the compilation of the `diffutils` port work, which expected a `char* const* argv` signature. And indeed, the POSIX spec does not mention permutation of `argv`: https://pubs.opengroup.org/onlinepubs/9699919799/functions/getopt.html However, most implementations do modify `argv` as evidenced by documentation such as: https://refspecs.linuxbase.org/LSB_5.0.0/LSB-Core-generic /LSB-Core-generic/libutil-getopt-3.html "The function prototype was aligned with POSIX 1003.1-2008 (ISO/IEC 9945-2009) despite the fact that it modifies argv, and the library maintainers are unwilling to change this." Change the behavior back to permutate `argc` to allow for the following command line argument order to work again: unzip ./file.zip -o target-dir Without this change, `./file.zip` in the example above would have been ignored completely.
2021-06-12AK: Rename Vector::append(Vector) => Vector::extend(Vector)Andreas Kling
Let's make it a bit more clear when we're appending the elements from one vector to the end of another vector.
2021-06-12LibJS: Add all of the WeakMap.prototype methods (delete, get, has, set)Idan Horowitz
2021-06-11AK+LibX86: Generalize u128/256 to AK::UFixedBigIntHendiadyoin1
Doing these as custom classes might be faster, especially when writing them in SSE, but this would cause a lot of Code duplication and due to the nature of constexprs and the intelligence of the compiler they might be using SSE/MMX either way
2021-06-09LibJS: Notify WeakSets when heap cells are sweepedIdan Horowitz
This is an implementation of the following optional optimization: https://tc39.es/ecma262/#sec-weakref-execution