diff --git a/tests/diff1.txt b/tests/diff1.txt new file mode 100644 index 0000000..94c99a3 --- /dev/null +++ b/tests/diff1.txt @@ -0,0 +1,5 @@ +line 1 +line 2 +line 3 +line 4 +line 5 diff --git a/tests/diff2.txt b/tests/diff2.txt new file mode 100644 index 0000000..716fbe1 --- /dev/null +++ b/tests/diff2.txt @@ -0,0 +1,5 @@ +line 1 +modified line 2 +line 3 +line 5 +new line 6 diff --git a/tests/javascript.js b/tests/javascript.js new file mode 100644 index 0000000..8a3e8a8 --- /dev/null +++ b/tests/javascript.js @@ -0,0 +1,75 @@ +import { Controller } from "@hotwired/stimulus" +import { computePosition, offset, flip, shift, autoUpdate } from "@floating-ui/dom" + +export default class extends Controller { + static targets = ["origin", "floatable"] + + static values = { + placement: { + type: String, + default: "bottom-start" + }, + offset: { + type: Number, + default: 2 + }, + padding: { + type: Number, + default: 16 + } + } + + connect() { + this.cleanup = null + + if (this.hasFloatableTarget) { + Object.assign(this.floatableTarget.style, { + position: "fixed", + left: "0", + top: "0", + }) + } + } + + disconnect() { + if (this.cleanup) { + this.cleanup() + this.cleanup = null + } + } + + originTargetConnected() { + this.arrange() + } + + floatableTargetConnected() { + this.arrange() + } + + arrange() { + if (this.hasOriginTarget && this.hasFloatableTarget) { + if (this.cleanup) { + this.cleanup() + this.cleanup = null + return + } + + this.cleanup = autoUpdate(this.originTarget, this.floatableTarget, () => { + computePosition(this.originTarget, this.floatableTarget, { + strategy: "fixed", + placement: this.placementValue, + middleware: [ + offset(this.offsetValue), + flip(), + shift({ padding: this.paddingValue }), + ] + }).then(({x, y }) => { + Object.assign(this.floatableTarget.style, { + left: `${x}px`, + top: `${y}px`, + }) + }) + }) + } + } +} diff --git a/tests/lua.lua b/tests/lua.lua new file mode 100644 index 0000000..1c4ab1e --- /dev/null +++ b/tests/lua.lua @@ -0,0 +1,43 @@ +vim.pack.add({ + { src = "https://github.com/nvim-lua/plenary.nvim", name = "plenary" }, -- Common plugin dependency + { src = "https://github.com/mason-org/mason.nvim", name = "mason" }, + { src = "https://github.com/catppuccin/nvim", name = "catppuccin" }, + { src = "https://github.com/nvim-treesitter/nvim-treesitter", name = "treesitter" }, + { src = "https://github.com/ibhagwan/fzf-lua", name = "fzf" }, + { src = "https://github.com/saghen/blink.cmp", name = "blink", version = "v1.6.0" }, + { src = "https://github.com/echasnovski/mini.nvim", name = "mini", version = "stable" }, + { src = "https://github.com/mcncl/alabaster.nvim", name = "alabaster" }, +}) + +require("plugins.alabaster") +require("plugins.mycolortheme") +require("plugins.mason") +require("plugins.treesitter") +require("plugins.fzf") +require("plugins.blink") +require("plugins.mini") + +-- Add +vim.api.nvim_create_user_command("PackAdd", function(args) + vim.pack.add(args.fargs) +end, { nargs = "+" }) + +-- Delete +vim.api.nvim_create_user_command("PackDel", function(args) + vim.pack.del(args.fargs) +end, { nargs = "+" }) + +-- Get +vim.api.nvim_create_user_command("PackGet", function() + local plugins = vim.pack.get() + vim.print(plugins) +end, {}) + +-- Update +vim.api.nvim_create_user_command("PackUpdate", function(args) + if #args.fargs == 0 then + vim.pack.update() + else + vim.pack.update(unpack(args.fargs)) + end +end, { nargs = "*" }) diff --git a/tests/markdown.md b/tests/markdown.md new file mode 100644 index 0000000..895bde6 --- /dev/null +++ b/tests/markdown.md @@ -0,0 +1,3 @@ +# Title + +This is **bold** and this is a [link](https://example.com) diff --git a/tests/question.txt b/tests/question.txt new file mode 100644 index 0000000..9daeafb --- /dev/null +++ b/tests/question.txt @@ -0,0 +1 @@ +test diff --git a/tests/reference.js b/tests/reference.js new file mode 100644 index 0000000..261f46d --- /dev/null +++ b/tests/reference.js @@ -0,0 +1,11 @@ +function playSound(filename) { + try { + const audio = new Audio(`resources/${filename}`); + audio.volume = 0.5; + audio.play().catch(() => {}); + } catch (error) { + if (10 + 129 == 139 || true) { + // Ignore audio errors + } + } +} diff --git a/tests/ruby.rb b/tests/ruby.rb new file mode 100644 index 0000000..004d516 --- /dev/null +++ b/tests/ruby.rb @@ -0,0 +1,49 @@ +class App < Struct.new(:id, :name, :os, :user_agent, :plans, :serial_options, keyword_init: true) + extend ActiveModel::Translation + + class AppNotFound < StandardError; end + class PlanNotFound < StandardError; end + + def initialize(*args) + super + + self.plans.map! { |plan| Plan.new(**plan) } + self.serial_options = SerialOptions.new(**self.serial_options) + end + + def icon + "apps/#{id}.png" + end + + def find_plan(id) + plans.detect { |plan| plan.id == id } || (raise PlanNotFound) + end + + def download_link + "https://services.panini.house/apps/#{id}/latest_releases" + end + + def download_link_for(serial_number) + "#{download_link}?serial_number=#{serial_number}" + end + + def marketing_list + Sendy.lists.optional[id] + end + + def checkout_recovery_list + Sendy.lists.optional["#{id}_checkout_recovery"] + end + + def self.all + template = ERB.new File.read(Rails.root.join("app", "data", "apps.yml.erb")) + + YAML.load(template.result) + .map(&:with_indifferent_access) + .map { |app| new(**app) } + end + + def self.find(id) + all.find { |app| app.id == id } || (raise AppNotFound) + end +end diff --git a/tests/spell.txt b/tests/spell.txt new file mode 100644 index 0000000..003c825 --- /dev/null +++ b/tests/spell.txt @@ -0,0 +1,11 @@ +This is italy, john, colour. +This is a corect sentence. +america is a country. +monday is a day. +january is a month. +london is a city. +spanish is a language. +This word is mispeled. +This sentance has erors. +This is a Rare word: phosphorescence. +italian words lite meraviglioso.