-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve schema generation from an xml doc whose name is also an
extension Fixes #805 Signed-off-by: azerr <azerr@redhat.com>
- Loading branch information
1 parent
da67a76
commit 1c9d3a3
Showing
2 changed files
with
42 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
.../extensions/contentmodel/participants/codeactions/NoGrammarConstraintsCodeActionTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2020 Red Hat Inc. and others. | ||
* All rights reserved. This program and the accompanying materials | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v20.html | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Red Hat Inc. - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.lemminx.extensions.contentmodel.participants.codeactions; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
/** | ||
* Generate grammar URI tests. | ||
* | ||
*/ | ||
public class NoGrammarConstraintsCodeActionTest { | ||
|
||
@Test | ||
public void generateGrammarURI() { | ||
String actual = NoGrammarConstraintsCodeAction.getGrammarURI("file:///C:/test.xml", "xsd"); | ||
assertEquals("file:///C:/test.xsd", actual); | ||
} | ||
|
||
@Test | ||
public void generateGrammarURIWithDot() { | ||
String actual = NoGrammarConstraintsCodeAction.getGrammarURI("file:///C:/.project", "xsd"); | ||
assertEquals("file:///C:/.project.xsd", actual); | ||
} | ||
|
||
} |