Skip to content
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
19 changes: 19 additions & 0 deletions Assets/Tests/InputSystem/APIVerificationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,25 @@
Assert.That(monoBehaviourTypesHelpUrls, Has.All.StartWith(InputSystem.kDocUrl));
}

[Test]
[Category("API")]
public void API_InputActionImporterHasHelpUrlToExistingManualPage()
{
const string manualPrefix = "/manual/";

var helpUrlAttribute = typeof(InputActionImporter).GetCustomAttribute<HelpURLAttribute>();
Assert.That(helpUrlAttribute, Is.Not.Null, "InputActionImporter has no HelpURL attribute, so the .inputactions Inspector help button falls back to a generated URL with no published page.");
Assert.That(helpUrlAttribute.URL, Does.StartWith(InputSystem.kDocUrl + manualPrefix));

var page = helpUrlAttribute.URL.Substring(InputSystem.kDocUrl.Length + manualPrefix.Length);
var anchorIndex = page.IndexOf('#');
if (anchorIndex >= 0)
page = page.Substring(0, anchorIndex);

Check warning on line 266 in Assets/Tests/InputSystem/APIVerificationTests.cs

View check run for this annotation

Codecov GitHub.com / codecov/patch

Assets/Tests/InputSystem/APIVerificationTests.cs#L266

Added line #L266 was not covered by tests

var markdownPath = "Packages/com.unity.inputsystem/Documentation~/" + Path.ChangeExtension(page, ".md");
Assert.That(File.Exists(markdownPath), Is.True, $"HelpURL of InputActionImporter points at {helpUrlAttribute.URL} but {markdownPath} does not exist.");
}

private const string kAPIDirectory = "Tools/API";

////FIXME: The .api-based checks are temporary and don't account for platform-specific APIs. Nuke these tests as soon
Expand Down
1 change: 1 addition & 0 deletions Packages/com.unity.inputsystem/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

### Fixed

- Fixed the Inspector help button for a selected `.inputactions` asset ("Open Reference for Input Action Importer") opening a missing documentation page; it now links to the Action Assets manual page [UUM-149518](https://issuetracker.unity3d.com/product/unity/issues/guid/UUM-149518)
- Fixed an `OverflowException` when creating a control scheme (or other named item) whose all-numeric name exceeds `Int32.MaxValue`, which previously discarded the entered name and fell back to the default [UUM-145766](https://issuetracker.unity3d.com/product/unity/issues/guid/UUM-145766)
- Fixed the Input Actions editor window logging a "Failed to load asset" exception on editor startup when its saved window layout was restored in a project where the referenced asset GUID did not resolve; the window now closes quietly instead [UUM-144318](https://issuetracker.unity3d.com/product/unity/issues/guid/UUM-144318)
- Empty foldouts are no longer shown for processors and interactions that have no settings (e.g. "Invert") [UUM-144325](https://issuetracker.unity3d.com/product/unity/issues/guid/UUM-144325)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ namespace UnityEngine.InputSystem.Editor
/// Will not overwrite existing wrappers except if the generated code actually differs.
/// </remarks>
[ScriptedImporter(kVersion, InputActionAsset.Extension)]
[HelpURL(InputSystem.kDocUrl + "/manual/action-assets.html")]
internal class InputActionImporter : ScriptedImporter
{
private const int kVersion = 14;
Expand Down
Loading