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

Windowing System tests not compiling #764

Open
gaetanomatonti opened this issue Aug 22, 2024 · 1 comment
Open

Windowing System tests not compiling #764

gaetanomatonti opened this issue Aug 22, 2024 · 1 comment

Comments

@gaetanomatonti
Copy link

In exercise "Windowing System" there is a compile issue with the test bundle. Specifically, the testMainWindow() function contains a reference to mainWindow, a Window instance that does not exist in its scope.

/mnt/exercism-iteration/Tests/WindowingSystemTests/WindowingSystemTests.swift:20:7: error: cannot find 'mainWindow' in scope
      mainWindow.display(),
      ^~~~~~~~~~

This causes the whole exercise to fail, both locally and on the online editor.

The fix is pretty straightforward, since we only need to add the following code to the function:

let mainWindow: Window = {
  let window = Window()
  window.title = "Main Window"
  window.contents = "This is the main window"
  window.resize(to: Size(width: 400, height: 300))
  window.move(to: Position(x: 100, y: 100))
  return window
}()
@landmaj
Copy link
Contributor

landmaj commented Sep 12, 2024

For anybody coming here due to the same error - you are supposed to create an instance of the Window class and assign it to mainWindow yourself. This is one of a few exercises where you have to read the entire instruction and implement almost everything (at least function stubs) before executing tests for the first time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants