Skip to content
Open
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
3 changes: 3 additions & 0 deletions tests/pkg/assets/missing-spec/gold/test.gold
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Aborted
[pkg, install]
Error: Project has a lock-file, but no specification file.
8 changes: 8 additions & 0 deletions tests/pkg/assets/missing-spec/package.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
prefixes:
pkg1: pkg1

packages:
pkg1:
url: 'http://localhost:<[*PORT*]>/pkg/pkg1'
version: 1.0.0
hash: deadbeef1234567890abcdef1234567890abcdef
11 changes: 11 additions & 0 deletions tests/pkg/missing-spec-gold-test.toit
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Copyright (C) 2025 Toit contributors.
// Use of this source code is governed by a Zero-Clause BSD license that can
// be found in the tests/LICENSE file.

import .gold-tester

main args:
with-gold-tester --with-git-pkg-registry args: test it

test tester/GoldTester:
tester.gold "test" [["pkg", "install"]]
4 changes: 4 additions & 0 deletions tools/pkg/project/project.toit
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ class Project:
--empty-lock-file/bool=false
--ui/cli.Ui:
ui_ = ui

if config.lock-file-exists and not config.specification-file-exists:
ui.abort "Project has a lock-file, but no specification file."

if config.specification-file-exists:
specification = ProjectSpecification.load this --ui=ui
else:
Expand Down
Loading