feat: reorganize workbook into 3 tracks (core, engineering-2026, ecosystems)
This commit is contained in:
1 parent
82677455b2
commit
2e002b6176
64 files changed
+2295
-196
No files matched your search
@@ -0,0 +1,16 @@
|
||||
# 03 — Programowanie Cross-Platform (Linux, Windows, macOS)
|
||||
|
||||
## Zakres
|
||||
* Abstrakcje ścieżek `Path` i `PathBuf` (nigdy nie sklejaj ścieżek przez `format!("{}/{}", ...)`!)
|
||||
* Kompilacja warunkowa: `#[cfg(target_os = "linux")]`, `#[cfg(target_os = "macos")]`, `#[cfg(target_os = "windows")]`
|
||||
* Bezpieczna obsługa zmiennych środowiskowych (wstrzykiwanie źródła zamiast globalnego stanu w testach)
|
||||
|
||||
## Zadania (`src/lib.rs`)
|
||||
1. `config_file_path(base_dir: &Path, app_name: &str) -> PathBuf` — zbuduj przenośną ścieżkę `<base_dir>/<app_name>/config.toml` używając `Path::join`.
|
||||
2. `current_os_label() -> &'static str` — użyj `#[cfg(target_os = "...")]`, aby zwrócić `"linux"`, `"macos"`, `"windows"` lub `"other"`.
|
||||
3. `has_extension(path: &Path, expected: &str) -> bool` — porównaj rozszerzenie pliku bez uwzględniania wielkości liter (ważne na Windows/macOS).
|
||||
|
||||
## Uruchomienie testów
|
||||
```bash
|
||||
make test PKG=eng03-cross-platform
|
||||
```
|
||||
Reference in new issue
Block a user