summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTim Hatch <tim@timhatch.com>2014-06-07 23:49:52 -0700
committerTim Hatch <tim@timhatch.com>2014-06-07 23:49:52 -0700
commit2f1c724903db081f1d6941d366ca95070049e94b (patch)
tree3f43531b55424c456c977fb809f773aec36dace0 /tests
parent712d327c39efd6109d6919657e21ae5cd1a15414 (diff)
parent68c8011b8980c91a74f4625a96fa0fa946fb7b67 (diff)
downloadpygments-2f1c724903db081f1d6941d366ca95070049e94b.tar.gz
Merged in megajoule/pygments-main (pull request #372)
Update ElixirLexer and ElixirConsoleLexer
Diffstat (limited to 'tests')
-rw-r--r--tests/examplefiles/example.liquid42
-rw-r--r--tests/examplefiles/r6rs-comments.scm23
-rw-r--r--tests/examplefiles/test.swift65
3 files changed, 130 insertions, 0 deletions
diff --git a/tests/examplefiles/example.liquid b/tests/examplefiles/example.liquid
new file mode 100644
index 00000000..8f3ea9e9
--- /dev/null
+++ b/tests/examplefiles/example.liquid
@@ -0,0 +1,42 @@
+# This is an example file. Process it with `./pygmentize -O full -f html -o /liquid-example.html example.liquid`.
+
+{% raw %}
+some {{raw}} liquid syntax
+
+{% raw %}
+{% endraw %}
+
+Just regular text - what happens?
+
+{% comment %}My lovely {{comment}} {% comment %}{% endcomment %}
+
+{% custom_tag params: true %}
+{% custom_block my="abc" c = false %}
+ Just usual {{liquid}}.
+{% endcustom_block %}
+
+{% another_tag "my string param" %}
+
+{{ variable | upcase }}
+{{ var.field | textilize | markdownify }}
+{{ var.field.property | textilize | markdownify }}
+{{ 'string' | truncate: 100 param='df"g' }}
+
+{% cycle '1', 2, var %}
+{% cycle 'group1': '1', var, 2 %}
+{% cycle group2: '1', var, 2 %}
+
+{% if a == 'B' %}
+{% elsif a == 'C%}' %}
+{% else %}
+{% endif %}
+
+{% unless not a %}
+{% else %}
+{% endunless %}
+
+{% case a %}
+{% when 'B' %}
+{% when 'C' %}
+{% else %}
+{% endcase %} \ No newline at end of file
diff --git a/tests/examplefiles/r6rs-comments.scm b/tests/examplefiles/r6rs-comments.scm
new file mode 100644
index 00000000..cd5c3636
--- /dev/null
+++ b/tests/examplefiles/r6rs-comments.scm
@@ -0,0 +1,23 @@
+#!r6rs
+
+#|
+
+ The FACT procedure computes the factorial
+
+ of a non-negative integer.
+
+|#
+
+(define fact
+
+ (lambda (n)
+
+ ;; base case
+
+ (if (= n 0)
+
+ #;(= n 1)
+
+ 1 ; identity of *
+
+ (* n (fact (- n 1))))))
diff --git a/tests/examplefiles/test.swift b/tests/examplefiles/test.swift
new file mode 100644
index 00000000..8ef19763
--- /dev/null
+++ b/tests/examplefiles/test.swift
@@ -0,0 +1,65 @@
+//
+// test.swift
+// from https://github.com/fullstackio/FlappySwift
+//
+// Created by Nate Murray on 6/2/14.
+// Copyright (c) 2014 Fullstack.io. All rights reserved.
+//
+
+import UIKit
+import SpriteKit
+
+extension SKNode {
+ class func unarchiveFromFile(file : NSString) -> SKNode? {
+
+ let path = NSBundle.mainBundle().pathForResource(file, ofType: "sks")
+
+ var sceneData = NSData.dataWithContentsOfFile(path, options: .DataReadingMappedIfSafe, error: nil)
+ var archiver = NSKeyedUnarchiver(forReadingWithData: sceneData)
+
+ archiver.setClass(self.classForKeyedUnarchiver(), forClassName: "SKScene")
+ let scene = archiver.decodeObjectForKey(NSKeyedArchiveRootObjectKey) as GameScene
+ archiver.finishDecoding()
+ return scene
+ }
+}
+
+class GameViewController: UIViewController {
+
+ override func viewDidLoad() {
+ super.viewDidLoad()
+
+ if let scene = GameScene.unarchiveFromFile("GameScene") as? GameScene {
+ // Configure the view.
+ let skView = self.view as SKView
+ skView.showsFPS = true
+ skView.showsNodeCount = true
+
+ /* Sprite Kit applies additional optimizations to improve rendering performance */
+ skView.ignoresSiblingOrder = true
+
+ /* Set the scale mode to scale to fit the window */
+ scene.scaleMode = .AspectFill
+
+ skView.presentScene(scene)
+ }
+ }
+
+ override func shouldAutorotate() -> Bool {
+ return true
+ }
+
+ override func supportedInterfaceOrientations() -> Int {
+ if UIDevice.currentDevice().userInterfaceIdiom == .Phone {
+ return Int(UIInterfaceOrientationMask.AllButUpsideDown.toRaw())
+ } else {
+ return Int(UIInterfaceOrientationMask.All.toRaw())
+ }
+ }
+
+ override func didReceiveMemoryWarning() {
+ super.didReceiveMemoryWarning()
+ // Release any cached data, images, etc that aren't in use.
+ }
+
+}