diff options
author | Eric Williams | 2017-06-27 15:36:49 +0000 |
---|---|---|
committer | Eric Williams | 2017-06-27 15:36:49 +0000 |
commit | 3497bb2c3f4d9c45919d0fc96652094cd1929cc0 (patch) | |
tree | 158ed4fe0ca1588fffd344177646196bd95e3a67 /tests | |
parent | 8f5c12dbbf0d52d77529e8b468c625831e5f4dd0 (diff) | |
download | eclipse.platform.swt-3497bb2c3f4d9c45919d0fc96652094cd1929cc0.tar.gz eclipse.platform.swt-3497bb2c3f4d9c45919d0fc96652094cd1929cc0.tar.xz eclipse.platform.swt-3497bb2c3f4d9c45919d0fc96652094cd1929cc0.zip |
Bug 518657: [GTK] Add bug snippets to GTK only tests project
Add a simple snippet for bug 483097 which tests GTK CSS regex.
Change-Id: I1a0475822f448c25cb1a4590026864a13db57bcd
Signed-off-by: Eric Williams <ericwill@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/org.eclipse.swt.tests.gtk/Bug Snippets/org/eclipse/swt/tests/gtk/snippets/Bug483097_RegexForegroundTesting.java | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/org.eclipse.swt.tests.gtk/Bug Snippets/org/eclipse/swt/tests/gtk/snippets/Bug483097_RegexForegroundTesting.java b/tests/org.eclipse.swt.tests.gtk/Bug Snippets/org/eclipse/swt/tests/gtk/snippets/Bug483097_RegexForegroundTesting.java new file mode 100644 index 0000000000..4c7549d844 --- /dev/null +++ b/tests/org.eclipse.swt.tests.gtk/Bug Snippets/org/eclipse/swt/tests/gtk/snippets/Bug483097_RegexForegroundTesting.java @@ -0,0 +1,24 @@ +package org.eclipse.swt.tests.gtk.snippets; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/* + * Title: Bug 483097 - [GTK3.16+] gtk_widget_override_color is deprecated + * How to run: launch snippet and check sysout + * Bug description: N/A + * Expected results: if the pattern on line 18 matches: true will be printed + * GTK Version(s): N/A + */ +public class Bug483097_RegexForegroundTesting { + + public static void main(String[] args) { + // Test string + String searched = "* {color: rgb(255, 0, 0);{"; + // Test pattern + String pattern = "[^-]color: rgba?\\((\\d+(,\\s?)?){3,4}"; + Pattern r = Pattern.compile(pattern); + Matcher m = r.matcher(searched); + System.out.println(m.find()); + } +} |