Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tests for nix 2.17 #99

Merged
merged 2 commits into from
Aug 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,11 @@ jobs:
uses: cachix/install-nix-action@v22
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
nix_path: nixpkgs=channel:nixos-unstable
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.channel }}
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Build
run: cargo build --all
run: nix develop .#full --command cargo build --all
- name: Test
run: cargo test --all -- --include-ignored
run: nix develop .#full --command cargo test --all -- --include-ignored

nix-flake:
name: Flake package
Expand Down
37 changes: 34 additions & 3 deletions crates/ide/src/ide/hover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,19 @@ mod tests {
`bool`

`builtins.true`
(No documentation from Nix)
Primitive value.

It can be returned by
[comparison operators](@docroot@/language/operators.md#Comparison)
and used in
[conditional expressions](@docroot@/language/constructs.md#Conditionals).

The name `true` is not special, and can be shadowed:

```nix-repl
nix-repl> let true = 1; in true
1
```
"#]],
);
check(
Expand Down Expand Up @@ -419,7 +431,19 @@ mod tests {
`bool`

`builtins.true`
(No documentation from Nix)
Primitive value.

It can be returned by
[comparison operators](@docroot@/language/operators.md#Comparison)
and used in
[conditional expressions](@docroot@/language/constructs.md#Conditionals).

The name `true` is not special, and can be shadowed:

```nix-repl
nix-repl> let true = 1; in true
1
```
"#]],
);

Expand All @@ -434,7 +458,14 @@ mod tests {
`{ abort: string → ?, add: float → float → float, addErrorContext: string → ? → ?, all: (? → bool) → [?] → bool, … }`

`builtins.builtins`
(No documentation from Nix)
Contains all the [built-in functions](@docroot@/language/builtins.md) and values.

Since built-in functions were added over time, [testing for attributes](./operators.md#has-attribute) in `builtins` can be used for graceful fallback on older Nix installations:

```nix
# if hasContext is not available, we assume `s` has a context
if builtins ? hasContext then builtins.hasContext s else true
```
"#]],
);
}
Expand Down
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.