fritx / mixed-playground

Test-driven doing LeetCode in Go, Python, Rust, Java and even Solidity!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

# 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
  • fix coverage for viem
  • solidity & hardhat
  • c & c++ testing
  • mixed c & c++ with go
  • cargo test
  • rust & rustc --test
  • gradle
  • java & maven & junit
  • diagrams_bks
  • diagrams
  • P2: python -m unittest discover -v
  • hacking cjk filenames & sub-directories & cwd
  • pytest
  • go test

Refs:

About

Test-driven doing LeetCode in Go, Python, Rust, Java and even Solidity!


Languages

Language:Go 27.2%Language:Python 25.6%Language:Java 12.2%Language:Rust 12.1%Language:Solidity 8.6%Language:C++ 7.6%Language:C 6.7%