Skip to content

Commit

Permalink
Be more consistent about kernels output name
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasjm committed Sep 22, 2024
1 parent 2ffa8b8 commit b828e3e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions codedown.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ rec {
# Exported so clients can build searchers for other package sets, like "codedown.searcher nixpkgs"
searcher = common.searcher;

settingsSchemas = lib.mapAttrs (attr: value: value.meta.settingsSchema or []) languages;
settingsSchemas = lib.mapAttrs (attr: value: value.meta.settingsSchema or []) kernels;

evaluateConfig = callPackage ./nix/evaluate-config.nix {
inherit pkgsStable pkgsMaster;
Expand Down Expand Up @@ -52,7 +52,7 @@ rec {
;
};

languages = everythingEnv.config.builtKernels;
kernels = everythingEnv.config.builtKernels;

makeEnvironment = callPackage ./nix/makeEnvironment.nix {
inherit pkgsStable pkgsMaster;
Expand Down
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
# inherit codedown;

# Tests use flake to do packageSearch builds
inherit (codedown) languages;
inherit (codedown) kernels;

# For .envrc
nixpkgsPath = pkgsStable.writeShellScriptBin "nixpkgsPath.sh" "echo -n ${pkgsStable.path}";
Expand Down
16 changes: 8 additions & 8 deletions tests/src/TestLib/TestSearchers.hs
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,20 @@ testKernelSearchersBuild :: (
HasBaseContext context, MonadIO m, MonadMask m, MonadUnliftIO m, MonadBaseControl IO m
) => Text -> SpecFree context m ()
testKernelSearchersBuild kernel = it [i|#{kernel}: package searchers build|] $ do
testBuild [i|.\#languages."#{kernel}".packageSearch|]
testBuild [i|.\#kernels."#{kernel}".packageSearch|]

testHasExpectedFields :: (
HasBaseContext context, MonadIO m, MonadMask m, MonadUnliftIO m, MonadBaseControl IO m
) => Text -> SpecFree context m ()
testHasExpectedFields kernel = it [i|#{kernel}: has expected fields|] $ do
testEval [i|.\#languages."#{kernel}".settingsSchema|]
testEval [i|.\#languages."#{kernel}".modes|]
testEval [i|.\#languages."#{kernel}".settings|]
testEval [i|.\#languages."#{kernel}".args|]
testEval [i|.\#languages."#{kernel}".meta|]
testEval [i|.\#kernels."#{kernel}".settingsSchema|]
testEval [i|.\#kernels."#{kernel}".modes|]
testEval [i|.\#kernels."#{kernel}".settings|]
testEval [i|.\#kernels."#{kernel}".args|]
testEval [i|.\#kernels."#{kernel}".meta|]

-- Used to view all versions in codedown-languages
testEval [i|.\#languages."#{kernel}".versions|]
testEval [i|.\#kernels."#{kernel}".versions|]

-- Testing for nonempty results

Expand All @@ -56,7 +56,7 @@ testKernelSearchersNonempty kernel = describe [i|#{kernel}: package and LSP sear
testPackageSearchNonempty :: (
HasBaseContext context, MonadIO m, MonadMask m, MonadUnliftIO m, MonadBaseControl IO m
) => Text -> ExampleT context m ()
testPackageSearchNonempty kernel = testSearcherHasNonemptyResults [i|.\#languages."#{kernel}".packageSearch|]
testPackageSearchNonempty kernel = testSearcherHasNonemptyResults [i|.\#kernels."#{kernel}".packageSearch|]

testSearcherHasNonemptyResults :: (MonadUnliftIO m, MonadThrow m, MonadLogger m, MonadFail m) => String -> m ()
testSearcherHasNonemptyResults expr = searcherResults expr >>= \case
Expand Down

0 comments on commit b828e3e

Please sign in to comment.