summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMithil Poojary <mithil467@gmail.com>2020-10-05 05:23:51 +0530
committerDavid Peter <sharkdp@users.noreply.github.com>2020-10-05 13:56:43 +0200
commit5fa164516560386900e019435892747b6f88c0ed (patch)
treec6b38c8cd9e7765cb56fcf5ac9cce72d4874b7b4 /tests
parentbbf6ec0458114b4d79abdad9ba297c7e1b3ded4d (diff)
Add Java file test
Diffstat (limited to 'tests')
-rw-r--r--tests/syntax-tests/highlighted/Java/test.java39
-rw-r--r--tests/syntax-tests/source/Java/test.java39
2 files changed, 78 insertions, 0 deletions
diff --git a/tests/syntax-tests/highlighted/Java/test.java b/tests/syntax-tests/highlighted/Java/test.java
new file mode 100644
index 00000000..014b3946
--- /dev/null
+++ b/tests/syntax-tests/highlighted/Java/test.java
@@ -0,0 +1,39 @@
+import java.util.Scanner;
+
+/* This Java program was submiited to help bat
+ * with its syntax highlighting tests
+ */
+
+public class Main
+{
+ public static void main(String[] arg)
+ {
+ Scanner st = new Scanner(System.in);
+ int t;
+ t = st.nextInt();
+ String tem;
+ tem = st.nextLine();
+ for(int zz=0;zz<t;zz++)
+ {
+ String str;
+ str = st.nextLine();
+ int n = str.length();
+ char ch;
+ for(int i=0;i<n;i++)
+ {
+ ch = str.charAt(i);
+ if(ch=='a')
+ System.out.print("n");
+ else if(ch=='s')
+ System.out.print("i");
+ else
+ System.out.print(ch);
+ }
+ System.out.println();
+ }
+ while(t!=0) {
+ // Decrement t
+ t -= 1;
+ }
+ }
+}
diff --git a/tests/syntax-tests/source/Java/test.java b/tests/syntax-tests/source/Java/test.java
new file mode 100644
index 00000000..340267a1
--- /dev/null
+++ b/tests/syntax-tests/source/Java/test.java
@@ -0,0 +1,39 @@
+import java.util.Scanner;
+
+/* This Java program was submiited to help bat
+ * with its syntax highlighting tests
+ */
+
+public class Main
+{
+ public static void main(String[] arg)
+ {
+ Scanner st = new Scanner(System.in);
+ int t;
+ t = st.nextInt();
+ String tem;
+ tem = st.nextLine();
+ for(int zz=0;zz<t;zz++)
+ {
+ String str;
+ str = st.nextLine();
+ int n = str.length();
+ char ch;
+ for(int i=0;i<n;i++)
+ {
+ ch = str.charAt(i);
+ if(ch=='a')
+ System.out.print("n");
+ else if(ch=='s')
+ System.out.print("i");
+ else
+ System.out.print(ch);
+ }
+ System.out.println();
+ }
+ while(t!=0) {
+ // Decrement t
+ t -= 1;
+ }
+ }
+}