Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fritx/mixed-playground
Test-driven doing LeetCode in Go, Python, Rust, Java and even Solidity!
https://github.com/fritx/mixed-playground
leetcode solidity testing
Last synced: about 2 months ago
JSON representation
Test-driven doing LeetCode in Go, Python, Rust, Java and even Solidity!
- Host: GitHub
- URL: https://github.com/fritx/mixed-playground
- Owner: fritx
- Created: 2024-02-19T10:01:12.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-04-10T09:30:53.000Z (9 months ago)
- Last Synced: 2024-04-10T10:38:26.998Z (9 months ago)
- Topics: leetcode, solidity, testing
- Language: Go
- Homepage:
- Size: 2.13 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
```sh
# Go
go clean -testcache
go test -v ./...
# w/ coverage
go test -cover ./...
go test -coverprofile=go_coverage.out ./...
go tool cover -func=go_coverage.out
go tool cover -html=go_coverage.out # serving html# Python
pytest -v -s
# w/ coverage
pip install pytest-cov
pytest --cov=.
pytest --cov=. --cov-report html:py_coverage
# html report is under `py_coverage` dir# Rust
rustc hello_world.rs -o hello_world_exe
./hello_world_exe
rustc --test hello_world.rs -o hello_world_test_exe
./hello_world_test_exe
cargo build
cargo build --release
cargo test -- --nocapture
cargo test --release -- --nocapture# Java
javac HelloWorld.java
java HelloWorld
mvn clean
mvn install
mvn test
mvn compile
java -cp target/classes me.fritx.App
mvn package
java -jar target/playground-1.0-SNAPSHOT.jar# Solidity
npm install # or pnpm install
REPORT_GAS=true npx hardhat test
# `SOLIDITY_COVERAGE=true` is required to fix for viem
SOLIDITY_COVERAGE=true npx hardhat coverage
```Roadmap:
- [ ] benchmarks
- [ ] bigdata & spark & hadoop
- [ ] [lang cheatsheet](./lang_cheatsheet.md)
- [x] fix coverage for viem
- [x] solidity & hardhat
- [ ] c & c++ testing
- [x] mixed c & c++ with go
- [x] cargo test
- [x] rust & rustc --test
- [ ] gradle
- [x] java & maven & junit
- [ ] diagrams_bks
- [x] [diagrams](./diagrams/)
- [ ] P2: python -m unittest discover -v
- [x] hacking cjk filenames & sub-directories & cwd
- [x] pytest
- [x] go testRefs:
- https://github.com/NomicFoundation/hardhat/pull/4961
- https://doc.rust-lang.org/rustc/instrument-coverage.html
- https://pytest-cov.readthedocs.io/en/latest/reporting.html
- https://github.com/golang/vscode-go/blob/master/docs/features.md#code-coverage
- https://brantou.github.io/2017/05/24/go-cover-story/
- https://junit.org/junit5/docs/current/user-guide/#running-tests-build