summaryrefslogtreecommitdiffstats
path: root/tools/lint/test/files/trojan-source
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:47:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:47:29 +0000
commit0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d (patch)
treea31f07c9bcca9d56ce61e9a1ffd30ef350d513aa /tools/lint/test/files/trojan-source
parentInitial commit. (diff)
downloadfirefox-esr-0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d.tar.xz
firefox-esr-0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d.zip
Adding upstream version 115.8.0esr.upstream/115.8.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tools/lint/test/files/trojan-source')
-rw-r--r--tools/lint/test/files/trojan-source/README5
-rw-r--r--tools/lint/test/files/trojan-source/commenting-out.cpp9
-rw-r--r--tools/lint/test/files/trojan-source/early-return.py9
-rw-r--r--tools/lint/test/files/trojan-source/invisible-function.rs15
4 files changed, 38 insertions, 0 deletions
diff --git a/tools/lint/test/files/trojan-source/README b/tools/lint/test/files/trojan-source/README
new file mode 100644
index 0000000000..343a9d0c3c
--- /dev/null
+++ b/tools/lint/test/files/trojan-source/README
@@ -0,0 +1,5 @@
+These examples are taken from trojan source:
+https://github.com/nickboucher/trojan-source
+
+The examples are published under the MIT license.
+
diff --git a/tools/lint/test/files/trojan-source/commenting-out.cpp b/tools/lint/test/files/trojan-source/commenting-out.cpp
new file mode 100644
index 0000000000..d67df70ce1
--- /dev/null
+++ b/tools/lint/test/files/trojan-source/commenting-out.cpp
@@ -0,0 +1,9 @@
+#include <iostream>
+
+int main() {
+ bool isAdmin = false;
+ /*‮ } ⁦if (isAdmin)⁩ ⁦ begin admins only */
+ std::cout << "You are an admin.\n";
+ /* end admins only ‮ { ⁦*/
+ return 0;
+} \ No newline at end of file
diff --git a/tools/lint/test/files/trojan-source/early-return.py b/tools/lint/test/files/trojan-source/early-return.py
new file mode 100644
index 0000000000..2797d8ae9f
--- /dev/null
+++ b/tools/lint/test/files/trojan-source/early-return.py
@@ -0,0 +1,9 @@
+#!/usr/bin/env python3
+bank = { 'alice': 100 }
+
+def subtract_funds(account: str, amount: int):
+ ''' Subtract funds from bank account then ⁧''' ;return
+ bank[account] -= amount
+ return
+
+subtract_funds('alice', 50) \ No newline at end of file
diff --git a/tools/lint/test/files/trojan-source/invisible-function.rs b/tools/lint/test/files/trojan-source/invisible-function.rs
new file mode 100644
index 0000000000..b32efb0372
--- /dev/null
+++ b/tools/lint/test/files/trojan-source/invisible-function.rs
@@ -0,0 +1,15 @@
+fn isAdmin() {
+ return false;
+}
+
+fn is​Admin() {
+ return true;
+}
+
+fn main() {
+ if is​Admin() {
+ printf("You are an admin\n");
+ } else {
+ printf("You are NOT an admin.\n");
+ }
+} \ No newline at end of file