PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: cobalt-org/liquid-rust (rust)

Issue:
`truncate` has overflow problems
`thread 'conformance_ruby::standard_filter_test::test_truncate' panicked at 'attempt to subtract with overflow', src/filters/mod.rs:218:22`

- [Rust implementation](https://github.com/cobalt-org/liquid-rust/blob/master/src/filters/mod.rs)
- [Ruby implementation](https://github.com/Shopify/liquid/blob/master/lib/liquid/standardfilters.rb)
- [Relevant tests](https://github.com/cobalt-org/liquid-rust/search?q=liquid+264&unscoped_q=liquid+264)
  - Once this is working, ideally the test will start failing.  We would just need to remove the `#[should_panic]` on it
  - If the test doesn't start failing, please temporarily remove `#[should_panic]`, and find or create an issue for the new failure

Pull request:
fix(std): Overflow in `truncate`
Fixes #264


Patch:
diff --git a/crates/lib/src/stdlib/filters/string/truncate.rs b/crates/lib/src/stdlib/filters/string/truncate.rs
index dca97e5..cd33010 100644
--- a/crates/lib/src/stdlib/filters/string/truncate.rs
+++ b/crates/lib/src/stdlib/filters/string/truncate.rs
@@ -72,13 +72,15 @@ impl Filter for TruncateFilter {
         let args = self.args.evaluate(runtime)?;
 
         let lenght = args.lenght.unwrap_or(50) as usize;
-
         let truncate_string = args.ellipsis.unwrap_or_else(|| "...".into());
-
-        let l = cmp::max(lenght - truncate_string.len(), 0);
+        let diff = if lenght >= truncate_string.len() {
+            lenght - truncate_string.len()
+        } else {
+            0
+        };
+        let l = cmp::max(diff, 0);
 
         let input_string = input.to_kstr();
-
         let result = if lenght < input_string.len() {
             let result = UnicodeSegmentation::graphemes(input_string.as_str(), true)
                 .take(l)


Test patch:
diff --git a/tests/conformance_ruby/standard_filter_test.rs b/tests/conformance_ruby/standard_filter_test.rs
index 1682e04..703af94 100644
--- a/tests/conformance_ruby/standard_filter_test.rs
+++ b/tests/conformance_ruby/standard_filter_test.rs
@@ -142,7 +142,6 @@ fn test_slice_on_arrays() {
 }
 
 #[test]
-#[should_panic] // liquid-rust#264
 fn test_truncate() {
     assert_eq!(
         v!("1234..."),
Repository: tailwindlabs/tailwindcss-jit (js)

Issue:
Outline utility no longer aligned with docs
Thanks for the great improvements, this is really making fun!

While testing with an existing project I discovered that the outline utility right now differs from the `tailwindcss`' version (and the documentation as well) for it's `outline-offset`. `@tailwindcss/jit` generates f.e. `.outline-white: {outline: 2px dotted white; outline-offset: 0;}`, while the original version compiles to `.outline-white: {outline: 2px dotted white; outline-offset: 2px;}`.

Pull request:
Fix handling of outline offsets
Resolves #82 

Patch:
diff --git a/src/corePlugins/outline.js b/src/corePlugins/outline.js
index e806599..f71adbd 100644
--- a/src/corePlugins/outline.js
+++ b/src/corePlugins/outline.js
@@ -1,17 +1,11 @@
 const nameClass = require('tailwindcss/lib/util/nameClass').default
-const transformThemeValue = require('tailwindcss/lib/util/transformThemeValue').default
-
-function isPlainObject(value) {
-  return typeof value === 'object' && value !== null
-}
 
 module.exports = function ({ matchUtilities, jit: { theme } }) {
   matchUtilities({
     outline: (modifier, { theme }) => {
-      let transformValue = transformThemeValue('outline')
-      let value = transformValue(theme.outline[modifier])
+      let value = theme.outline[modifier]
 
-      if (modifier === '' || value === undefined) {
+      if (value === undefined) {
         return []
       }
 


Test patch:
diff --git a/tests/01-basic-usage.test.css b/tests/01-basic-usage.test.css
index 1eaa663..c41a09f 100644
--- a/tests/01-basic-usage.test.css
+++ b/tests/01-basic-usage.test.css
@@ -553,11 +553,11 @@
 }
 .outline-none {
   outline: 2px solid transparent;
-  outline-offset: 0;
+  outline-offset: 2px;
 }
 .outline-black {
   outline: 2px dotted black;
-  outline-offset: 0;
+  outline-offset: 2px;
 }
 .ring {
   --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width)